The source of userdetails.php (click to demo the file) viewed 2894 times.
If I wrote this code, then it is licensed under the GPL. If someone else wrote it, then please ask them if you want to use the code.
<?php
// Start "page made in" timer this need to be at the top of your PHP page
$ss_timing_start_times = explode(' ', microtime());
// Check Referer
if ($_SERVER[HTTP_REFERER]=="")
{
$referrer = "N/A";
}
else
{
$referrer = "<a href=$_SERVER[HTTP_REFERER] target=_blank><font size=1>$_SERVER[HTTP_REFERER]</font></a>";
}
// Get hostname
$r_hostname = gethostbyaddr($_SERVER[REMOTE_ADDR]);
if ($_SERVER[REMOTE_ADDR] == "$r_hostname") {
$r_hostname = "$_SERVER[REMOTE_ADDR]";
}
else
{
$r_hostname = "$_SERVER[REMOTE_ADDR] / $r_hostname";
}
// Display details
echo "<b>Your IP / host:</b> <a href=networktest/index.php?submit=true&portNum=80&queryType=all&target=$_SERVER[REMOTE_ADDR] target=_blank><font size=1>$r_hostname</font></a><br><b>Your Referrer:</b> <font size=1>$referrer</font><br><b>Your Browser & OS:</b> <font size=1>$_SERVER[HTTP_USER_AGENT]</font></font><br>";
// Work out how long the page took to generate
if (!isset($ss_timing_start_times))
{
}
if (!isset($ss_timing_stop_times))
{
$stop_time = explode(' ', microtime());
}
else
{
$stop_time = $ss_timing_stop_times;
}
// do the big numbers first so the small ones aren't lost
$current = $stop_time[1] - $ss_timing_start_times[1];
$current += $stop_time[0] - $ss_timing_start_times[0];
echo "<b>Page made in:</b> <font size=1>";
echo round($current,4);
echo " secs</font>";
?>
If you want to have a look at the source code, chose a file from this list:
To colour code your own PHP paste it here: