guest book

Login Failed (Bad Password)\n"); } ?> Controls"; } ?> "; echo ""; if ($admin) { echo ""; } echo "\n"; } fclose($file); if ($delete) { fclose($tfile); unlink($guestbook); rename("$guestbook.tmp", $guestbook); } } function clean($name, $max) { # Turn tabs and CRs into spaces so they can't # fake other fields or extra entries $name = ereg_replace("[[:space:]]", ' ', $name); # Escape < > and and & so they # can't mess withour HTML markup $name = ereg_replace('&', '&', $name); $name = ereg_replace('<', '<', $name); $name = ereg_replace('>', '>', $name); # Don't allow excessively long entries $name = substr($name, 0, $max); # Undo PHP's "magic quotes" feature, which has # inserted a \ in front of any " characters. # We undo this because we're using a file, not a # database, so we don't want " escaped. Those # using databases should do the opposite: # call addslashes if get_magic_quotes_gpc() # returns false. return $name; } function passwordField() { global $admin; global $password; if (!$admin) { return; } hiddenField('password', $password); } function hiddenField($name, $value) { echo ""; } ?>
DateNameEmailComment
$date$name$email$comment"; echo "
"; passwordField(); hiddenField('id', $id); echo ""; echo "
"; echo "
Admin Login

Admin Password:

Sign My Guestbook!
Name
Email
Comment