Jump to content

I don't get what's wrong...


Recommended Posts

I keep getting this error:Parse error: syntax error, unexpected '{' in /homepages/31/d229779882/htdocs/upload/member.php on line 16I looked over the code a few times but I can't find the problem with the "Parse error: syntax error, unexpected '{'"So help please. :)

<?php$sql= mysql_connect("SERCET 3x");$database=mysql_select_db("db238906134");$past = time() - 100;//connectif (!$sql){die('Could not connect: ' . mysql_error());}if (!$database){die ('Could not select db: ' . mysql_error());}if (isset($_COOKIE["username"]){$username = $_COOKIE['Username'];$password = $_COOKIE['Password'];$check = mysql_query("SELECT * FROM Member WHERE Username = '$username'")or die(mysql_error());while($info = mysql_fetch_array( $check )){ if ($password != $info['password']){die('Sorry but your password is wrong. <a href="index.php>try again</a>"' . 'setcookie(Username, gone, $past)' . 'setcookie(Password, gone, $past)'>}else{echo "<a href=upload.php>Upload</a>";echo "<a href=files.php>Your Files</a>";echo "<a href=logout.php>Logout</a>";echo "<a href=delete.php>Delete Account</a>";}}}else//if the cookie does not exist, they are taken to the login screen{header("Location: index.php");}?>
Link to post
Share on other sites

You need to learn how to find these errors yourself. The error message says it found something unexpected on line 25. So look at line 25. All it is is a single "}" character, there's nothing illegal about that. But if it's saying that it's not expecting that character then there must be a problem higher up that is causing it to become confused. Look at line 24.

Link to post
Share on other sites

Lines 15 to 42:I think I had corrected the problem...

if (isset($_COOKIE["username"])){$username = $_COOKIE['Username'];$password = $_COOKIE['Password'];$check = mysql_query("SELECT * FROM Member WHERE Username = '$username'")or die(mysql_error());while($info = mysql_fetch_array( $check )){ if ($password != $info['password']){die('Sorry but your password is wrong. <a href=index.php>try again</a> . setcookie(Username, gone, $past) . setcookie(Password, gone, $past)')}else{echo "<a href=upload.php>Upload</a>";echo "<a href=files.php>Your Files</a>";echo "<a href=logout.php>Logout</a>";echo "<a href=delete.php>Delete Account</a>";}}}else//if the cookie does not exist, they are taken to the login screen{header("Location: index.php");}?>

Link to post
Share on other sites
<?php$sql= mysql_connect("SERCET 3x");$database=mysql_select_db("db238906134");$past = time() - 100;//connectif (!$sql){	die('Could not connect: ' . mysql_error());	}if (!$database){	die ('Could not select db: ' . mysql_error());	}if (isset($_COOKIE["username"])){	$username = $_COOKIE['Username'];	$password = $_COOKIE['Password'];	$check = mysql_query("SELECT * FROM Member WHERE Username = '$username'")or die(mysql_error());	while($info = mysql_fetch_array( $check )){	if ($password != $info['password']){		die('Sorry but your password is wrong. <a href="index.php>try again</a>"');		} else {			echo "<a href=upload.php>Upload</a>";			echo "<a href=files.php>Your Files</a>";			echo "<a href=logout.php>Logout</a>";			echo "<a href=delete.php>Delete Account</a>";		}	}} else {//if the cookie does not exist, they are taken to the login screen	header("Location: index.php");	}?>

Try that. The curly braces were messed up and a semi-colon missing here and ther, and a bracket, too, I think.Check to see if that is any better.

Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...