Lonefighter Posted December 17, 2006 Share Posted December 17, 2006 The Code:[code]<? session_start(); include 'dbConfig.php'; $ip = $_SERVER['REMOTE_ADDR']; //get the ip of the current user if(!isset($_SESSION['session_username']) || empty($_SESSION['session_username']) || $ip!= $_SESSION['session_ip']) { //if the username is not set or the session username is empty or the ip does not match the session ip log them out session_unset(); //clears firefox session_destroy(); //clears IE echo "ERROR!!!"; exit; } ?> <? if($session_level == "3") { echo "You are not of the required level to access this page."; } else { ?><font face="Verdana" size="1">Here you can add a user. The user will automatically be able to login.<p> <? if($action == "register") { include ("dbConfig.php"); if(!$username_register || !$password_register) { echo "<br><br><b>You must enter a username and password!</b>"; exit; } $password_register = md5($password_register); $query = mysql_query("INSERT INTO `staff` (`username`, `password`, `email`, `level`) VALUES('$username_register', '$password_register', '$email_register', '$level_register')") or die("<br><b><font face=verdana size=1>Error: User not added to database.</b><br> You have got this error becuase the name you have chosen is being used by a current member or we cannot connect to the database, please try a different name or try again later"); echo "<font face=verdana size=1>Account Created"; } else { echo "<form method=post action=?action=register> <table border=0> <tr><td><font face=verdana size=1>Username:</td><td><input name=username_register MAXLENGTH=16></td></tr> <tr><td><font face=verdana size=1>Email Address:</td><td><input name=email_register></td></tr> <tr><td><font face=verdanasize=1>Password: <td><input name=password_register></td></tr> <tr><td><font face=verdana size=1>Level:</td><td><font face=verdana size=1><select name=level_register> <option value=5>Reporter</option><option value=3>Senior DJ</option> <option value=2>DJ</option> <option value=1>Admin</option> </select></td></tr> <tr><td></td><td><input type=submit value= Add User accesskey=s></td></tr> </table> </form>"; ] ] ?> </font> [/code]It is the code is for a DJ PAnel for shoutcast internet streaming, it relates to a DJ Panel where by you cna add users. However, when i fill the information table the page simply refrreshes and no users are added.The problem either relies within this code, of which I hope you guys can help me with / within a MySql table i have created.Cheers for any help given...Edit... Is that OK ? Quote Link to comment Share on other sites More sharing options...
papaface Posted December 17, 2006 Share Posted December 17, 2006 Please use {code} {/code} around your code - replace { & } with [ & ] Quote Link to comment Share on other sites More sharing options...
Lonefighter Posted December 17, 2006 Author Share Posted December 17, 2006 now when i run this code the submit boxes dont even appear... (After changing all the { and }to [ and ] )I get this error:Parse error: syntax error, unexpected ']' in /home/*******/public_html/DJPanel/add_user.php on line 1 Quote Link to comment Share on other sites More sharing options...
trq Posted December 17, 2006 Share Posted December 17, 2006 We can't read you code!Format it (as everyone else does) so its readable, and please as has been mentioned, use the [ code ] [ / code ] tags. 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.