I assume that you are running the page through the php parser already? Either by using a ".php" file extension or by modifications to the .htaccess file as required.
The method required to post the page generation time (not the load time) is to include a section of php code at the top of the page which creates a start time and another section of code at the bottom which creates a stop time. To find the page generation time is simply a matter of subtracting one from the other and echoing it to the html page. Here is some code for that:
CODE
<?php $time_start = microtime (true); ?> // place early on the page
:
:
<?php // place this code late in the page
$time_end = microtime (true);
$load_time = $time_end - $time_start;
echo "Page Generated in $load_time seconds";
?>
This code works as is for php5 only. If your server is running php 4, there is a function available on the php site that will work for the earlier versions. Search their site ( www.php.com ? ) for the microtime() function and it is explained in the first example box.
To display the User'$s IP address, you reference the Global values found in the "$_SERVER" array. The complete list of information that is available in the Array can be found by printing the contents of the array using the following code:
CODE
<?php
print_r($_SERVER);
But of course, you only want one element of the array, so rather than displaying all the data, use the following bit of code on the page where you want the IP address displayed:
CODE
<?php
echo "Your IP Address is $_SERVER[REMOTE_ADDR]";
?>
Hope this helps.
Comment/Reply (w/o sign-up)