= 2) { // check for submit if ($_SERVER['REQUEST_METHOD']=="POST" ) { // check for unique username $result = mysql_query("SELECT user_name FROM user WHERE user_name='$user_name'") or die(mysql_error()); if(mysql_num_rows($result) == 0) { $user_name = $_POST['user_name']; $user_pass = md5($config_user_pass); $user_level = $_POST['user_level']; $displayname = $_POST['user_name']; mysql_query("INSERT INTO user (user_name, user_pass, user_level, displayname) VALUE ('$user_name', '$user_pass', '$user_level', '$displayname')") or die(mysql_error()); header_location("options.php"); } echo 'Error!'; } ?>