Newbie ?: why this error?

From: Date: Wed, 05 Sep 2001 01:51:47 +0000
Subject: Newbie ?: why this error?
Groups: php.general 
Request: Send a blank email to php-general+get-65974@lists.php.net to get a copy of this message
Not only am I new to PHP, I'm new to programming altogether. I'm trying to take it step by step, and my first big experiment was the script below, used to enter info from a form into a mySQL database. I get the following error message when it runs: Parse error: parse error, expecting ','' or ';'' in /www/ideasforimages/request_sample.php on line 8 I've been stuck on this all afternoon. The opening PHP tag is what's on line 8. I've run other simple scripts with the same tag, so it doesn't seem to be a problem with the server set-up or application. Any help would be greatly appreciated! Vicki Here's the the first part of the script in question: <html> <head> <title>Sample Request Results</title> </head> <body> <p>Thank you for requesting a sample. Here it is.</p> <? if (!$SampFirstName || !$SampLastName || !$SampEmail) { echo "You have not entered all the required information. <br>" "Please go back and try again."; exit; } $SampFirstName = addslashes ($SampFirstName); $SampLastName = addslashes ($SampLastName) ; $SampEmail = addslashes ($SampEmail); $db = mysql_connect ("hostname", "user", "password"); if (!$db) { echo "Error: Could not connect to database. Please try again later."; exit; }

« previous php.general (#65974) next »