bleured27 Posted July 19, 2012 Share Posted July 19, 2012 i Know it is Kind a lame becose its a basic error i tried over an our to find it only i faild so i come here plz help me Parse error: syntax error, unexpected '}' in /Applications/XAMPP/xamppfiles/htdocs/sessions/bannthem.php on line 52 <?php ini_set('display_errors', 'On'); error_reporting(E_ALL); session_start(); if ($_SESSION["loggedin"] == null): header("location:home.php"); endif; $host = 'localhost'; // Server Host Name $user = 'root'; // Server User Name $password = ''; // Server Password $db = 'test'; // Your Database $link = mysql_connect($host,$user,$password) or die('Error in Server information'); mysql_select_db($db,$link) or die('Can not Select Databasse'); $query = "select * from userinfo where username='{$_SESSION['theuser']}' and password='{$_SESSION['pass']}'"; $res = mysql_query($query) or die(mysql_error()); $rows = mysql_num_rows($res); if($rows!=1) { header('location:home.php'); } elseif($_SESSION['theuser']=="bleured"); $banuser= $_POST['username2']; $unban= $_POST['username']; if($unban==$banuser): header('location:ban.php'); endif; if($unban!=""); { $query2 = "select * from userinfo where username='$unban'"; } $res2 = mysql_query($query2); //Executing query and saving result in Result Set $rows2 = mysql_num_rows($res2); if($rows2==1) { mysql_query("UPDATE userinfo SET ban='0' where username='$unban'") } else { echo"not a correct username"; } if($banuser!=""): $query3 = "select * from userinfo where username='$banuser'" } $res3 = mysql_query($query3); //Executing query and saving result in Result Set $rows3 = mysql_num_rows($res3); if($rows3==1) { mysql_query(UPDATE userinfo SET ban='1' where username='$banuser'); } else { echo"not a correct username"; $query3 = "select * from userinfo where username='$unban'" } endif include'ban.php'; else { header('location:home.php'); } Quote Link to comment Share on other sites More sharing options...
Jessica Posted July 19, 2012 Share Posted July 19, 2012 Did you look at line 52? What comes immediately before it? This is basic debugging. Quote Link to comment Share on other sites More sharing options...
hakimserwa Posted July 19, 2012 Share Posted July 19, 2012 it doesnt hurt any thing but its a good practice to avoid these problems always wrap your ifs in {} Quote Link to comment Share on other sites More sharing options...
bleured27 Posted July 19, 2012 Author Share Posted July 19, 2012 i tried to fix still nothing worKed for me ps if you Know how see line numbers in text editor it would be great and firefox acting wierd it tries to open .php exstations in my texteditor Quote Link to comment Share on other sites More sharing options...
Jessica Posted July 19, 2012 Share Posted July 19, 2012 1. What text editor are you using? 2. You can fix that in your firefox settings. Quote Link to comment Share on other sites More sharing options...
Maq Posted July 19, 2012 Share Posted July 19, 2012 3. Learn to use spell check and not capitalize random letters. Quote Link to comment Share on other sites More sharing options...
Jessica Posted July 19, 2012 Share Posted July 19, 2012 4. While we're on it, if your signature is not meant to be ironic, it's spelled "wrong". Quote Link to comment Share on other sites More sharing options...
hakimserwa Posted July 19, 2012 Share Posted July 19, 2012 4. While we're on it, if your signature is not meant to be ironic, it's spelled "wrong". solve one problem at a go first thing first i guess. Quote Link to comment Share on other sites More sharing options...
bleured27 Posted July 19, 2012 Author Share Posted July 19, 2012 text editor Versie 1.4 (220) Bewerking van RTF-, Word-, HTML-, Unicode?- en platte-tekstbestanden. Copyright ? 1995-2005 Apple Computer, Inc. Alle rechten voorbehouden. OKEY Quote Link to comment Share on other sites More sharing options...
hakimserwa Posted July 19, 2012 Share Posted July 19, 2012 try this <?php ini_set('display_errors', 'On'); error_reporting(E_ALL); session_start(); if ($_SESSION["loggedin"] == null){ header("location:home.php"); } $host = 'localhost'; // Server Host Name $user = 'root'; // Server User Name $password = ''; // Server Password $db = 'test'; // Your Database $link = mysql_connect($host,$user,$password) or die('Error in Server information'); mysql_select_db($db,$link) or die('Can not Select Databasse'); $query = "select * from userinfo where username='{$_SESSION['theuser']}' and password='{$_SESSION['pass']}'"; $res = mysql_query($query) or die(mysql_error()); $rows = mysql_num_rows($res); if($rows!=1) { header('location:home.php'); } elseif($_SESSION['theuser']=="bleured"){ $banuser= $_POST['username2']; $unban= $_POST['username']; if($unban==$banuser){ header('location:ban.php'); } } if($unban!=""){ $query2 = "select * from userinfo where username='$unban'"; $res2 = mysql_query($query2); //Executing query and saving result in Result Set $rows2 = mysql_num_rows($res2); if($rows2==1) { mysql_query("UPDATE userinfo SET ban='0' where username='$unban'") } else { echo"not a correct username"; } if($banuser!=""){ $query3 = "select * from userinfo where username='$banuser'" $res3 = mysql_query($query3); //Executing query and saving result in Result Set $rows3 = mysql_num_rows($res3); } if($rows3==1) { mysql_query(UPDATE userinfo SET ban='1' where username='$banuser'); } else { echo"not a correct username"; $query3 = "select * from userinfo where username='$unban'" } include('ban.php'); else { header('location:home.php'); } Quote Link to comment Share on other sites More sharing options...
Jessica Posted July 19, 2012 Share Posted July 19, 2012 Your version still has the error. OP: download a programming text editor. Textpad is wonderfully simple, and has a mac client. Quote Link to comment Share on other sites More sharing options...
bleured27 Posted July 19, 2012 Author Share Posted July 19, 2012 ithe last script buggd virst on line 2 Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /Applications/XAMPP/xamppfiles/htdocs/sessions/bannthem.php on line 2 Quote Link to comment Share on other sites More sharing options...
Jessica Posted July 19, 2012 Share Posted July 19, 2012 'On' should be 1. ini_set Quote Link to comment Share on other sites More sharing options...
bleured27 Posted July 19, 2012 Author Share Posted July 19, 2012 can u give me linK textpad download? Quote Link to comment Share on other sites More sharing options...
Jessica Posted July 19, 2012 Share Posted July 19, 2012 http://lmgtfy.com/?q=Textpad Quote Link to comment Share on other sites More sharing options...
bleured27 Posted July 19, 2012 Author Share Posted July 19, 2012 i only see windows download and the script's second error Parse error: syntax error, unexpected T_STRING in /Applications/XAMPP/xamppfiles/htdocs/sessions/bannthem.php on line 7 Quote Link to comment Share on other sites More sharing options...
ignace Posted July 20, 2012 Share Posted July 20, 2012 Download TextWrangler: http://lmgtfy.com/?q=TextWrangler Quote Link to comment Share on other sites More sharing options...
hakimserwa Posted July 20, 2012 Share Posted July 20, 2012 can u give me linK textpad download? you can also try textmate is abit advanced Quote Link to comment 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.