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:

server_mon.php
(Demo Script)
perl_smtp_email.php
(Demo Script)
cookies.php
(Demo Script)
pad_test.php
(Demo Script)
md5_password.php
(Demo Script)
userdetails.php
(Demo Script)
ip.txt
(Demo Script)
email.php
(Demo Script)
phpself.php
(Demo Script)
htpasswd_maker.php
(Demo Script)
url_verify.php
(Demo Script)
birthday.php
(Demo Script)
phpinfo.php
(Demo Script)
password.php
(Demo Script)
time.php
(Demo Script)
mysql_backup.php
(Demo Script)
smarty.php
(Demo Script)
char_limit.php
(Demo Script)
title_case.php
(Demo Script)
convert_link.php
(Demo Script)
unix_time.php
(Demo Script)
html.php
(Demo Script)
ip_monitor.php
(Demo Script)
floor_time.php
(Demo Script)

To colour code your own PHP paste it here: