<?php
 introduction to php tutorial
 brief examples by greg lawler
 december 2000 brooks web 
class

$foo "Greg";

print 
"Hello $foo";

?>

// set a cookie called name and set it to expire in 144000 seconds 40 hours
setcookie("name", $name, time()+144000, ""); 

if ($Count) ++$Count; //if the $Count exists, increment it by one 
else $Count = 1; // otherwise, set $Count to 1 for the first visit...

// set another cookie called Count 
setcookie("Count",$Count, time()+144000, "");

if (!$name)
        {
    print "Hello Guest<br>";
    print "What is your name?";
    print "<form method=post action=$PHP_SELF>";
    print "<input type=text size=10 name=name>";
    print "<br>";
    print "Number of times you've been here: <b><font color=orange> $Count </font> </b><BR>";
        }

else
        {
        $Count++;
        print "<h3>Welcome $name !</h3><br>";
        print "Number of times you've been here: <b><font color=orange> $Count </font> </b>";
        print "<br>&nbsp;<br>&nbsp;<br>&nbsp;";
        }
?>