Jump to content

strange erro on line 73


damiendarien

Recommended Posts

I am having an issue with this code. Im trying to find the problem listed as the error but i might need someone from the outside to look at it for me.

<?php

if (empty($_GET['email']) || empty($_GET['email_confirm']) || empty($_GET['password']) || empty($_GET['password_confirm']))
exit("<p>You must enter values in all fields of the Frequent Flyer Registration form! Click your browser's Back button to return to the previous page.</p>");

else if
	(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_GET['email']))
		exit("<p>You must enter a valid e-mail address! Click your browser's Back button to return to the previous page.</p>");
else if 
	($_GET['email'] != $_GET['email_confirm'])
		exit("<p>You did not enter the same e-mail address! Click your browser's Back button to return to the previous page.</p>");
else if 
	($_GET['password'] != $_GET['password_confirm'])
		exit("<p>You did not enter the same password! Click your browser's Back button to return to the previous page.</p>");
else if
	(strlen($_GET['password']) < 5 || strlen($_GET['password']) > 10)
		exit("<p>Your password must be between 5 and 10 characters! Click your browser's Back button to return to the previous page.</p>");

$DBConnect = @mysqli_connect("localhost", "********", "********")
Or die("<p>Unable to connect to the database server.</p>"
	. "<p>Error code " . mysqli_connect_errno()
	. ": " . mysqli_connect_error()) . "</p>";
$DBName = "skyward_aviation";
@mysqli_select_db($DBConnect, $DBName)
Or die("<p>Unable to select the database.</p>"
	. "<p>Error code " . mysqli_errno($DBConnect)
	. ": " . mysqli_error($DBConnect)) . "</p>";

$TableName = "frequent_flyer";
$Email = addslashes($_GET['email']);
$Password = addslashes($_GET['password']);
$SQLstring = "SELECT * FROM $TableName";
$QueryResult = @mysqli_query($DBConnect, $SQLstring);

if (mysqli_num_rows($QueryResult) > 0) {
	$Row = mysqli_fetch_row($QueryResult);
	do {
			if (in_array($Email, $Row))
				exit("<p>The e-mail address you entered is already registered! Click your browser's Back button to return to the previous page.</p>");
			$Row = mysqli_fetch_row($QueryResult);
	} while ($Row);
	mysqli_free_result($QueryResult);

$SQLstring = "INSERT INTO $TableName VALUES(NULL, '$Email', '$Password', NULL, NULL, NULL, NULL, NULL, NULL, NULL)";
$QueryResult = @mysqli_query($DBConnect, $SQLstring)
Or die("<p>Unable to execute the query.</p>"
	. "<p>Error code " . mysqli_errno($DBConnect)
	. ": " . mysqli_error($DBConnect)) . "</p>";
$FlyerID = mysqli_insert_id($DBConnect);
mysqli_close($DBConnect);


?>
<p>Your new frequent flyer ID is <strong>
<?= $FlyerID ?></strong>.</p>

 

here is the error on the page

Parse error: syntax error, unexpected $end in C:\xampp\htdocs\PHP_Projects\Chapter.10\RegisterFlyer.php on line 73

Thanks for any help on this issue, ive been going crazy

Link to comment
https://forums.phpfreaks.com/topic/212722-strange-erro-on-line-73/
Share on other sites

thanks. i knew all it would take is another set of eyes to view it and solve. Had another issue but it was another simple mistake on mislabeling variables.

But now i have the issue to where when it is trying to show results inside the body element <?= $FlyerID =>  but in the page it doesnt show up. How can i fix this? is it something in the php.ini file?

 

Also for some reason when i go through the pages to the site it doenst hold the username and password and says i need to sign in again. What would cause that?

Thanks again

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.