Jump to content

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


Cod-nes

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 comment
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 comment
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 comment
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 comment
Share on other sites

Archived

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

×
×
  • Create New...