Here is the entire code (didn't want to post it due to size) The actual problem here is that it will not update the database. It never sees the $_POST['submitted_2'] in the register section.
<?php
$db = "testdb_1";
include("login.inc");
if(isset($POST['upload'])) {
?>
<html>
<head>
<title> :: TEST :: == Upload</title>
</head>
<body>
This Is Where The Upload Script Will Be
</body>
</html>
<?PHP
exit();
}
if(isset($POST['login'])) {
?>
<html>
<head>
<title> :: TEST :: == Login</title>
</head>
<body>
<form method="post" action="<?php $SERVER[PHP_SELF] ?>">
Login Name:
<input type="text" name="username">
<BR>
Password:
<input type="password" name="userpass">
<BR>
<input type="hidden" name="submitted_1">
<input type="submit" name="submit">
</form>
</body>
</html>
<?php
exit();
}
if(isset($POST['register'])) {
if(isset($POST['submitted_2'])) {
$name = $_POST['new_user_name'];
if($new_user_pass_1 == $new_user_pass_2) {
$pass = $_POST['new_user_pass_1'];
$sql_string = "INSERT INTO users (name, password) VALUES ('$name', md5($pass))";
mysql_query($sql_string);
?>
<html>
<head>
<title> :: TEST :: == Registering New User </title>
</head>
<body>
User Registered
</body>
</html>
<?php
}else{
echo "Passwords Do Not Match!";
}
exit();
}else{
?>
<html>
<head>
<title> :: TEST :: == Register</title>
</head>
<body>
<form method="post" action="<?php $SERVER[PHP_SELF] ?>">
Pick A User Name:
<input type="text" name="new_user_name">
<BR>
Pick A Password:
<input type="password" name="new_user_pass_1">
<BR>
Please Verify Your Password:
<input type="password" name="new_user_pass_2">
<BR>
<input type="hidden" name="submitted_2">
<input type="submit" name="submit_2">
</form>
</body>
</html>
<?php
exit();
}
}
?>
<html>
<head>
<title> :: TEST :: == Login</title>
</head>
<body>
<form method="post" action="<?php $SERVER[PHP_SELF] ?>">
<input type="submit" name="upload" value="Upload">
<BR>
<input type="submit" name="register" value="Register">
<BR>
<input type="submit" name="login" value="Log In">
</form>
</body>
</html>