First of all, make sure PHP is working. Make a page with only this code on it and save it with any name you want, then send your browser to it:
<?php
phpinfo();
?>
If that works, then your problem is with the scripts. Many books and tutorials were written assuming globals were turned on, which is a security risk and the default installation of PHP has them turned off. The scripts are simple enough to fix, but make sure PHP is working first.