ecabrera Posted January 13, 2012 Share Posted January 13, 2012 it says i have an error in in line 23 which is i cant seem to find it <?php if($_POST['loginbtn']){ require "scripts/connect.php"; $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); if($email && $password){ $password = md5("$password"); $query = mysql_query("SELECT * FROM ezadmin WHERE email = '$email'"); $numrows = mysql_num_rows($query); if($numrows != 0){ $row = mysql_fetch_assoc($query); //line 23 $dbemail = $row ['email']; $dbpassword = $row ['password']; if($dbemail === $email && $dbpassword === $password){ $_SESSION['email'] = $dbemail; header("location: adminpanel"); exit(); }else $msg = "PLEASE CHECK YOU EMAIL OR PASSWORD!"; }else $msg = "PERSON DOES NO EXSIT!"; }else $msg = "YOU MUST FILL IN ALL FIELDS!"; mysql_close(); } ?> Link to comment https://forums.phpfreaks.com/topic/254983-small-error/ Share on other sites More sharing options...
Muddy_Funster Posted January 13, 2012 Share Posted January 13, 2012 show us the full page, and tell us what the error is Link to comment https://forums.phpfreaks.com/topic/254983-small-error/#findComment-1307431 Share on other sites More sharing options...
ecabrera Posted January 13, 2012 Author Share Posted January 13, 2012 Parse error: syntax error, unexpected $end on line 23 <?php session_start(); $email = $_SESSION['email']; ?> <?php if($_POST['loginbtn']){ require "scripts/connect.php"; $email = mysql_real_escape_string($_POST['email']); $password = mysql_real_escape_string($_POST['password']); if($email && $password){ $password = md5("$password"); $query = mysql_query("SELECT * FROM ezadmin WHERE email = '$email'"); $numrows = mysql_num_rows($query); if($numrows != 0){ $row = mysql_fetch_assoc($query); $dbemail = $row ['email']; $dbpassword = $row ['password']; if($dbemail === $email && $dbpassword === $password){ $_SESSION['email'] = $dbemail; header("location: adminpanel"); exit(); }else $msg = "PLEASE CHECK YOU EMAIL OR PASSWORD!"; }else $msg = "PERSON DOES NO EXSIT!"; }else $msg = "YOU MUST FILL IN ALL FIELDS!"; mysql_close(); } ?> <?php require "header.php" ?> <form action="adminpanel.php" method='post'> <table> <tr> <td></td> <td><?php echo $msg;?></td> </tr> <tr> <td>Email</td> <td><input type="text" name="email" /></td> </tr> <tr> <td>Password</td> <td><input type="password" name="password" /></td> </tr> <tr> <td></td> <td><input type="submit" name="loginbtn" value="Login" /></td> </tr> </table> </form> <?php require "footer.php"?> Link to comment https://forums.phpfreaks.com/topic/254983-small-error/#findComment-1307433 Share on other sites More sharing options...
Muddy_Funster Posted January 13, 2012 Share Posted January 13, 2012 it's a long shot, but try removing the quotes from $password = md5("$password"); Also, why are you breaking out of php just to go strait back into it again? Link to comment https://forums.phpfreaks.com/topic/254983-small-error/#findComment-1307435 Share on other sites More sharing options...
ecabrera Posted January 14, 2012 Author Share Posted January 14, 2012 idk i will fix let me see it ok Link to comment https://forums.phpfreaks.com/topic/254983-small-error/#findComment-1307436 Share on other sites More sharing options...
ecabrera Posted January 14, 2012 Author Share Posted January 14, 2012 fixed it <form action="adminpanel.php" method='post'> <form action="index.php" method='post'> Link to comment https://forums.phpfreaks.com/topic/254983-small-error/#findComment-1307441 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.