elite_prodigy Posted December 1, 2008 Share Posted December 1, 2008 I can't figure out why i'm getting Parse error: syntax error, unexpected '[' in /home/exembar/public_html/team/php/login.php on line 23 I haven't missed any semicolons or anything, I am soo lost here. This is the code throwing the error: <?php include 'config.php'; mysql_select_db("exembar_site")or die("Cannot find specified Database!"); $user=$_POST['user']; $pass=$_POST['pass']; $user= stripslashes($myusername); $pass= stripslashes($mypassword); $user= mysql_real_escape_string($myusername); $pass= mysql_real_escape_string($mypassword); $sql="SELECT * FROM `staff` WHERE `username`='$user' AND `password`='$pass'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ while($info = mysql_fetch_array($result)){ $id = info['id']; $user = info['username']; session_start(); $_SESSION['id'] = $id; $_SESSION['user'] = $user; } header("location:http://team.exembarstudios.exofire.net"); } else { session_start(); $_SESSION['error'] = "Invalid Username or Password"; } ?> all help is appreciated. Link to comment https://forums.phpfreaks.com/topic/135052-solved-parse-error/ Share on other sites More sharing options...
revraz Posted December 1, 2008 Share Posted December 1, 2008 $id = $info['id']; $user = $info['username']; Link to comment https://forums.phpfreaks.com/topic/135052-solved-parse-error/#findComment-703435 Share on other sites More sharing options...
elite_prodigy Posted December 1, 2008 Author Share Posted December 1, 2008 But, that's what I have. Link to comment https://forums.phpfreaks.com/topic/135052-solved-parse-error/#findComment-703444 Share on other sites More sharing options...
wildteen88 Posted December 1, 2008 Share Posted December 1, 2008 No you don't this is what you have: $id = info['id']; $user = info['username']; You have forgotten $ before info Link to comment https://forums.phpfreaks.com/topic/135052-solved-parse-error/#findComment-703448 Share on other sites More sharing options...
elite_prodigy Posted December 1, 2008 Author Share Posted December 1, 2008 Oh, GOD! *kicks self* I hate the stupid mistakes. Thanks guys.... Link to comment https://forums.phpfreaks.com/topic/135052-solved-parse-error/#findComment-703467 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.