Jump to content

Need a lil help please...


Lonefighter

Recommended Posts

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 ?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.