Jump to content

Recommended Posts

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]

Link to comment
https://forums.phpfreaks.com/topic/220883-parse-errors-hours-of-head-banging-fun/
Share on other sites

<!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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.