Question #1

This question first submitted by Marcel van Bochove

[While] trying your code I received the following warnings :

Warning: Variable passed to reset() is not an array or object in
/path/to/guestbook.php on line 10
 
Warning: Variable passed to key() is not an array or object in
/path/to/guestbook.php on line 11

The warnings were on the following two lines :

for(reset($HTTP_POST_VARS);
  $key=key($HTTP_POST_VARS);

Answer #1

One of the features in PHP that this script relies on is the TRACK_VARS. This feature returns an associative array for every GET and POST form action and for all COOKIES set in a session. They are called HTTP_GET_VARS, HTTP_POST_VARS, and HTTP_COOKIE_VARS. If you want to act on all user input and do not know what might be returned by a form, turning on TRACK_VARS in the PHP INI file or adding:

<?php_track_vars?>

as the first line of the guestbook application will correct this problem.