xyn Posted July 30, 2006 Share Posted July 30, 2006 Hi guys,My login script isn't working, I get unexpected $end at line 99.it's missing the "session_start();" because i have it at the TOP of my page.before the HTML headers.My code:[code=php:0]<?PHP session_start(); ?><html><head><meta http-equiv="Content-Language" content="en-gb"><meta name="keywords" content="Eumod, Eurpean modified cars, modded, mod, customized"><meta name="description" content="Eumod is a discussion wbesite and fitting company. we're proud of our services and expanding."><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><link rel="stylesheet" type="text/css" href="style.css"><title>EZone Logging in</title></head><body><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td width="1%"> </td> <td width="98%"> </td> <td width="1%"> </td> </tr> <tr> <td width="1%"> </td> <td width="98%"><?PHP $user = $_POST['user']; $pass = $_POST['pass']; if(isset($_POST['user']) && empty($_POST['user'])) { $error[] = "Please enter your username"; } if(isset($_POST['pass']) && empty($_POST['pass'])) { $error[] = "Please enter your password"; } if(is_array($error)) { echo '<p class="text">Error:<UL>'; foreach($error as $key => $val) { echo "<LI>" . $val . "</LI>"; } echo '</UL></p>'; exit; } include "../db/db.php"; $sql = mysql_query("SELECT user,pass FROM accounts WHERE user='".strtolower($_POST['user'])."' AND pass='".md5($_POST['pass'])."'"); $num = @mysql_num_rows($sql); if( !num ) { $fault[] = "Your Username does not exist."; } $ql = mysql_query("SELECT adm_ban,pri_active FROM accounts WHERE user='".strtolower($_POST['user'])."' AND pass='".md5($_POST['pass'])."'"); while($data = mysql_fetch_array($ql, MYSQL_NUM)) { $ban = $data[0]; $act = $data[1]; if( $ban == "y" ) { $fault[] = "Sorry, you have been banned. Please email eumod support for more information."; } if( $act != "y" ) { $fault[] = "Your acocunt has not been activated."; } if(is_array($fault)) { echo '<p class="text">Error:<UL>'; foreach($fault as $key => $val) { echo "<LI>" . $val . "</LI>"; } echo '</UL></p>'; exit; }else{ $_SESSION['LoggedIn'] = true; echo '<meta http-equiv="REFRESH" content="0;URL=../index.php">'; } ?></td> <td width="1%"> </td> </tr> <tr> <td width="1%"> </td> <td width="98%"> </td> <td width="1%"> </td> </tr></table></body></html>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/16041-end-error/ Share on other sites More sharing options...
redarrow Posted July 30, 2006 Share Posted July 30, 2006 can you kindly make the code look better use the tab so i dont have to use the scoll bar cheers.point out 99 please cheers. Quote Link to comment https://forums.phpfreaks.com/topic/16041-end-error/#findComment-66068 Share on other sites More sharing options...
redarrow Posted July 30, 2006 Share Posted July 30, 2006 Had a quick look and i think you got a phase error becouse you dont backslash your double quotesBut when you post the correct error and show the error line may be someone can help ok. Quote Link to comment https://forums.phpfreaks.com/topic/16041-end-error/#findComment-66071 Share on other sites More sharing options...
xyn Posted July 30, 2006 Author Share Posted July 30, 2006 Let me updaste the whole code. and line 99 is </html> Quote Link to comment https://forums.phpfreaks.com/topic/16041-end-error/#findComment-66072 Share on other sites More sharing options...
redarrow Posted July 30, 2006 Share Posted July 30, 2006 [code]<?PHP session_start(); ?><html><head><meta http-equiv="Content-Language" content="en-gb"><meta name="keywords" content="Eumod, Eurpean modified cars, modded, mod, customized"><meta name="description" content="Eumod is a discussion wbesite and fitting company. we're proud of our services and expanding."><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><link rel="stylesheet" type="text/css" href="style.css"><title>EZone Logging in</title></head><body><table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><tr> <td width="1%"> </td> <td width="98%"> </td> <td width="1%"> </td> </tr> <tr> <td width="1%"> </td> <td width="98%<?PHP$user = $_POST['user'];$pass = $_POST['pass']; if(isset($_POST['user']) && empty($_POST['user'])){$error[] = "Please enter your username";}if(isset($_POST['pass']) && empty($_POST['pass'])){$error[] = "Please enter your password";} if(is_array($error)){echo "<p class='text'>Error:<UL>"; foreach($error as $key => $val){echo "<LI>'" . $val . "'</LI>";}echo "</UL></p>";exit;} include "../db/db.php";$sql = mysql_query("SELECT user,pass FROM accounts WHERE user='".strtolower($_POST['user'])."' AND pass='".md5($_POST['pass'])."'");$num = @mysql_num_rows($sql); if( !num ){$fault[] = "Your Username does not exist.";} $ql = mysql_query("SELECT adm_ban,pri_active FROM accounts WHERE user='".strtolower($_POST['user'])."' AND pass='".md5($_POST['pass'])."'");while($data = mysql_fetch_array($ql, MYSQL_NUM)){$ban = $data[0];$act = $data[1];if( $ban == "y" ){$fault[] = "Sorry, you have been banned. Please email eumod support for more information.";}if( $act != "y" ){$fault[] = "Your acocunt has not been activated.";}if(is_array($fault)){echo "<p class='text'>Error:<UL>"; foreach($fault as $key => $val){echo "<LI>'" . $val . "'</LI>";echo "</UL></p>";exit; }else{ $_SESSION['LoggedIn'] = true;echo "<meta http-equiv='REFRESH' content='0;URL=../index.php'>"; }?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/16041-end-error/#findComment-66077 Share on other sites More sharing options...
pixy Posted July 30, 2006 Share Posted July 30, 2006 Unexpected $end means you are missing one or more brackets } somewhere. There's a sticky post about this here:http://www.phpfreaks.com/forums/index.php/topic,100473.0.html Quote Link to comment https://forums.phpfreaks.com/topic/16041-end-error/#findComment-66083 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.