Posts Tagged ‘Displaying’

Displaying the Last Modified Date within a Web Page

Monday, July 14th, 2008

If you would like to display the last modified date on your web page, place the following code within the HTML of your web page where you would like the date to appear.

Example:

This page was last modified on: 06/18/2008 04:45:20

Last Modified HTML Code:

<script language=”Javascript”>
document.write(”This page was last modified on: ” + document.lastModified +”");
</SCRIPT>

Change the text indicated in red to whatever you’d like.

If you would like to use this JavaScript code to display your web page’s last modified date, it is probably best to place the code toward the bottom of your web page.

Displaying HTML Web Page Text in a Specific Font Style

Sunday, July 13th, 2008

The FONT tag is used to display your text in a specific style.

Although you may specify the font style you would like your text to be displayed, please keep in mind, if your visitor doesn’t have the font face you specify on their computer, the text will be displayed in the users default font setting.

To make sure your pages are being viewed as you intended, you should include alternative fonts within your HTML web page font tag.

<FONT face=”Verdana,Helvetica,Arial”>Your Text</FONT>

The code above tells the browser to display your text in Verdana, but if your visitor doesn’t have Verdana to display your text in Helvetica and so on.

By including font alternatives, you can ensure your page will be displayed exactly as you had intended.

SEO:Stop/Prevent MSN From Displaying your web site DMOZ Descriptions

Monday, June 30th, 2008

meta NAME=”ROBOTS” CONTENT=”NOODP”

PHP:Exclude/Stop PHP script notices/warnings from displaying

Monday, June 30th, 2008

error_reporting(E_ALL ^ E_NOTICE);

Displaying Page Loading Time (Steps and Sample Code)

Saturday, June 28th, 2008

Here is how to display your page’s loading time:

1. Use the function microtime() to get the time in micro-seconds
2. Use the explode() function to turn the micro-time into an array.
3. Combine the two parts to the array (the micro-seconds to the seconds).
4. Repeat steps 1,2 and 3 for the bottom of the page
5. Take the time taken at the end of the page from the time taken at the top of the page to determine the total loading time.
6. After rounding the microtime, return it to the browser.

At the top of your page, place:

$m_time = explode(” “,microtime());
$m_time = $m_time[0] + $m_time[1];
$starttime = $m_time;
?>

At the bottom of your page, place:

$round = 3;// The number of decimal places to round the micro time to.
$m_time = explode(” “,microtime());
$m_time = $m_time[0] + $m_time[1];
$endtime = $m_time;
$totaltime = ($endtime - $starttime);
echo “Page loading took:”. round($totaltime,$round) .” seconds”;
?>