DJTim666 Posted June 26, 2007 Share Posted June 26, 2007 Here is the code. Like it says in the title I am getting the unexpected $end error near the end of the coding. <?php include('header.php'); echo"<font color='blue'>Welcome %yourname to the account mananger section, please follow all admin rules before doing anything elligal!<br><br></font>"; echo"<a href='$PHP_SELF'>Home</a> | <a href='$PHP_SELF?act=edit'>Edit-User</a> | Warn | Browse-Users | CheckUser-Logs | FreezeUser | IPBANN<br><br>"; if(!$act) { echo"This will show how many users you have frozen, edit etc. to be done very soon"; } /////Start edit user if($act == 'edit') { if($userinfo[level] <= 0) { showerror("Sorry but you dont have access to this area yet!"); } if(!isset($_POST[e_user])) { echo"Enter username to edit.<br> <form action='$PHP_SELF?act=edit' method='post'> <input type='text' name='e_user'><br> <input type='submit' value='Edit User!'><br> "; } if(isset($_POST[e_user])) { $e_user = mysql_real_escape_string($_POST[e_user]); $sql0 = mysql_query("SELECT * FROM user WHERE username='$e_user'"); $sql = mysql_fetch_array($sql0); //Check to see if user exist if(mysql_num_rows($sql0) == 0) { showerror("User does not exist!"); } //Shows the edituser input echo <<<EDITU Username: User-Id: Password: EDITU; } } //edit user ends include('footer.php'); ?> -- DJ Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 26, 2007 Share Posted June 26, 2007 if(isset($_POST[e_user])) { $e_user = mysql_real_escape_string($_POST[e_user]); $sql0 = mysql_query("SELECT * FROM user WHERE username='$e_user'"); $sql = mysql_fetch_array($sql0); }//missing Quote Link to comment Share on other sites More sharing options...
DJTim666 Posted June 26, 2007 Author Share Posted June 26, 2007 Your observant aren't you. If you check near the end it is closed with a bracket ! EDIT: Sorry about that. I edited the code, and my edited version(the version above) works perfectly. The uneditted version has to many '/////////' for a single line comment. Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 26, 2007 Share Posted June 26, 2007 add } at the end that will surely run Quote Link to comment Share on other sites More sharing options...
ryeman98 Posted June 26, 2007 Share Posted June 26, 2007 add } at the end that will surely run That wasn't there error. Count the braces before you post. Quote Link to comment Share on other sites More sharing options...
drummer101 Posted June 26, 2007 Share Posted June 26, 2007 I don't know if this will help you at all, but I always comment my closing brackets with the line they open, I.E if (isset($foo)){ echo $foo; } // if (isset($foo)) Quote Link to comment Share on other sites More sharing options...
mkoga Posted June 26, 2007 Share Posted June 26, 2007 Also cleaner indentation would help recognize blocks a little easier. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted June 26, 2007 Share Posted June 26, 2007 fyi most good text editors will actually allow you to collapse any thing that has {} so you can see really easily what you haven't/have closed. Most also will color highlight a terminating bracket when you are at the opener or vica versa. 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.