View Full Version : if Statement causing an error

07-31-2007, 11:42 PM
I get this error


which points to the if statement shown in the code below. I copied the lines below also. I am getting this straight from a book so I don't see what is wrong with it. I have tried commenting out other lines thinking it may actually be somewhere else that throws the error, but no good.

if (isset($_POST['submit'])) {
//from has been submitted
if(ini_get('magic_quotes_gpc')) { //see if magic quotes are turned on
}else{ //form has not been submitted

08-01-2007, 12:43 AM
That particular piece of code by it self does not generate an error. Post at least 20 lines of code prior to that. Also, use the php code tags (the little folded corner paper icon with "php" on it) around the code in your post to get the highlighting to help find things like mis-matched quotes. Posting the line number part of the error message and indicating which line in the posted code that refers to would also help.

08-01-2007, 01:23 AM
NEVER MIND! It was there and I couldn't see it. Literally! My contacts suck. Instead of a tilde in the error handling I had a single quote `

error_reporting(E_ALL & `E_NOTICE);

This line was just prior to the if.

None of this matters now except as an example of stupid errors.
New rule. Forget the contacts use cheesy reading glasses when working on my computer.