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
https://forums.phpfreaks.com/topic/30924-need-a-lil-help-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.