Need help with code please

i keep getting this error on line 97 but have no syntax there
Parse error: syntax error, unexpected $end in /home/eddie838/public_html/web290/register.php on line 97
Here is the code i have so far

<?php session_start(); ?> Mai Chi Apartment Living
<?php include("inc/banner.php"); ?>
<?php include("inc/nav.php"); ?>
	<?php
		$form = "<form method=\"post\" action=\"$_SERVER[PHP_SELF]\">
		<input type=\"hidden\" name=\"seen\" value=\"yes\" />
		<fieldset>
			<label for=\"username\">* User Name: </label>
			<input type=\"text\" name=\"username\" size=\"20\" value=\"$_POST[username]\" /><br />
			<label for=\"password1\">* Password: </label>
			<input type=\"password\" name=\"password1\" size=\"20\" /><br />
			<label for=\"password2\">* Confirm Password: </label>
			<input type=\"password\" name=\"password2\" size=\"20\" /><br />
			<label for=\"firstname\">* First Name: </label>
			<input type=\"text\" name=\"firstname\" size=\"20\" value=\"$_POST[firstname]\" /><br />
			<label for=\"lastname\">* Last Name: </label>
			<input type=\"text\" name=\"lastname\" size=\"20\" value=\"$_POST[lastname]\" /><br />
			<label for=\"email\">* Email: </label>
			<input type=\"text\" name=\"email\" size=\"20\" value=\"$_POST[email]\" /><br />
		</fieldset>
		
		<input type=\"submit\" value=\"Register\" />
		";
		if ($_POST['seen'] == "yes")
		{
			include("inc/connect.php");
			$send = "yes";
			$errMsg = "<span class=\"warning\">The following errors have occured.</span><br />";
			
			//// Ask if username exists here.
			$query = "SELECT uname FROM users WHERE uname='$_POST[username]'";
			$result = mysqli_query($connect, $query);
			$row = mysqli_fetch_array($result);
			if (count($row) >= 1)
			{
				$send = "no";
				$errMsg .= "<span class=\"warning\">Your username is already taken. Fix it or I'll punch you in the face!</span><br />";
			}
			else
			{
				//// ALL ERROR CHECKING GOES HERE!
				if ($_POST['password1'] != $_POST['password2'])
				{
					$send = "no";
					$errMsg .= "<span class=\"warning\">Your passwords don't match. Fix it or I'll punch you in the face!</span><br />";
				}
			}
			
			if ($send == "yes")
			{
				
				$query = "INSERT INTO users (uname, pwd) VALUES ('$_POST[username]', SHA1('$_POST[password1]'))";
				$result = mysqli_query($connect, $query) or die(mysqli_error());
				$query = "INSERT INTO userinfo (fname, lname, email) VALUES ('$_POST[firstname]', '$_POST[lastname]', '$_POST[email]')";
				$result = mysqli_query($connect, $query) or die(mysqli_error());
				if ($result)
				{
					$display = "Thank you for signing up!";
				}
				else
				{
					$display = "It didn't work, please try again later.";
				}
				echo ($display);
			}
			else
			{
				echo($errMsg . $form);
				
			}
		}
		else
		{
			echo($form);
		}
	?>
</div>
<div id="footer"><?php include("inc/footer.php"); ?></div>

Please use the code blocks when your posting code.

It looks fine to me. I ran it and did not get an error. However, the issue may be in the footer.php, banner.php, or nav.php file not this one.

That error means your missing a closing bracket or parentheses somewhere.

Sponsor our Newsletter | Privacy Policy | Terms of Service