Re: Newbie ?: why this error?

From: Date: Wed, 05 Sep 2001 02:18:59 +0000
Subject: Re: Newbie ?: why this error?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-65979@lists.php.net to get a copy of this message
Well this is progress! My sloppy semicolons seem to have been the problem. The error message has now moved down to line 14, which in Dreamweaver 4 is the closing "}" of that code block. Since the line numbers in the error messages don't seem to be exact, the problem is probably in the lines immediately following the code block: $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; } I'll start looking at these lines more closely now. Thanks for the help. I guess I was taking those error messages too literally and looking for the problem in the wrong place. Vicki In article <NEBBKBGAMLPMIDAJEALPCEEECHAA.dempsejn@georgetown.edu>, dempsejn@georgetown.edu (Jack Dempsey) wrote: > Hi Vicki, > > try this: > > <? > if (!$SampFirstName || !$SampLastName || !$SampEmail) > { > echo "You have not entered all the required information. <br>"; #<-- you > need a semi colon here and > > echo "Please go back and try again."; #<-- another echo here. > exit; > } > > you could also do this: > > <? > if (!$SampFirstName || !$SampLastName || !$SampEmail) > { > echo "You have not entered all the required information. <br> Please go back > and try again."; > exit; > } > > > Jack >

« previous php.general (#65979) next »