Basic yet usefull codes!
Posted: Sat May 30, 2009 4:18 am
Ok theese might not be the most complex codes arround but as they say less is more... Please post improvments if needed
Time
Date
Hit Counter
Ok put this code into your PHP document:
Now make a file called 'count.dat' and upload it to the same directory as the file with the php code above. Then CHMOD the counter file to 777.
Now this REALY basic but its usefull if you need to find info on your host but they dont tell you it...
There you go 
Time
Code: Select all
<?php echo date("H:i"); ?>Code: Select all
<?php echo gmdate("M d Y"); ?>Ok put this code into your PHP document:
Code: Select all
<?php
$counter_file = "count.dat";
if(!($fp = fopen($counter_file, "r"))) die ("Cannot open $counter_file.");
$counter = (int) fread($fp, 20);
fclose($fp);
$counter++;
echo "You're visitor No. $counter.";
$fp = fopen($counter_file, "w");
fwrite($fp, $counter);
fclose($fp);
?>Now this REALY basic but its usefull if you need to find info on your host but they dont tell you it...
Code: Select all
<?php phpinfo(); ?>