Nathan54AB Posted December 7, 2010 Share Posted December 7, 2010 I'm a newbie to PHP programming, and for that matter any programming. I've been learning with Larry Ullman's PHP For the World Wide Web Second Edition. I'm in a section that's indroducing the "if" concept and wrote their sample script. Testing it, I get the following error: Parse error: syntax error, unexpected '>' in directory\registration.php on line 26 For the life of me I can't figure out why it would be having this error and I can't spot any stray >'s (If that's what that error implies). Attached to this post is the file involved, registration.php. There is also a registration.html that the PHP file receives, but I'm not able to upload html files here. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/220883-parse-errors-hours-of-head-banging-fun/ Share on other sites More sharing options...
QuickOldCar Posted December 7, 2010 Share Posted December 7, 2010 <!DOCTYPE html PUBLIC "-//W3C// DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/shtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>Registration Form</title> </head> <body><?php ini_set('display_errors', 1); // Defines variables from registration.html. $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $email = $_POST['email']; $password = $_POST['passowrd']; $confirm = $_POST['confirm']; $birthday = $_POST['birthday']; $favGameGenre = $_POST['favGameGenre']; ?> <p>Registration results:</p> <?php if(empty($firstName)) { echo " <p>You must enter your first name.</p> "; } if(empty($lastName)) { echo " <p>You must enter your last name.</p> "; } if(empty($email)) { echo " <p>You must enter your email</p> "; } if(empty($password)) { echo " <p>You must enter a password</p> "; } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/220883-parse-errors-hours-of-head-banging-fun/#findComment-1143790 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.