Re: Parse Errors

From: Date: Sat, 14 Dec 2002 22:47:15 +0000
Subject: Re: Parse Errors
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-128303@lists.php.net to get a copy of this message
Andy, > I am a PHP beginner so this error may be a stupid one. Anyway, I'm > trying to write a simple addition script. The client enters two numbers, > then my script (adder.php) adds them. However, when the script is run, I > get "Parse Error On Line 3" I have no idea exactly what I have done wrong. > Here is the script. > > <? > print ("Your first number is:$firstnumber\n") > print ("Your second number is:$secondnumber\n") > $answer=$firstnumber+$second number > echo ("The answer is: $answer\n") > ?> > > Any help would be greatly appreciated. Thank you. PHP code lines must end with a semi-colon (;). Also, HTML newlines are <br> (not \n) Some PHPs won't like the short tags, recommend: <?PHP Regards, =dn

« previous php.general (#128303) next »