I checked my registration form and don't see any problems. Also, I tried doing this with only it checking the username and not the password and it said "Welcome Ne.OnZ!". So apparently, it's the password. Maybe it's not checking the encryption right? I'll post the register script, since I don't see any problems.
<?php
include("Connect.php");
mysql_select_db("divnx5_web");
$username = (4 <= strlen(trim($_POST['user']))) && (strlen(trim($_POST['user'])) <= 20) ? addslashes(trim($_POST['user'])) : null;
$password = (strlen($_POST['pass']) >= 8) ? md5($_POST['pass']) : null;
$password2 = (strlen($_POST['pass2']) >=8) ? md5($_POST['pass2']) : null;
$email = trim($_POST['email']) ? addslashes($_POST['email']) : null;
$checkbox = $_POST['read'];
function check($username, &$set)
{
$query = "SELECT * FROM `users` WHERE username = '".mysql_real_escape_string($username)."'";
$result = mysql_query($query) OR die("$query: " . mysql_error());
if(mysql_num_rows($result) > 0)
{
echo "The username " . $username . ' is already taken.';
$set = 1;
}
}
function register($username, $password, $email, &$res)
{
$que = "INSERT INTO users(username, password, email, rank) VALUES('$username', '$password', '$email', '1')";
$res = mysql_query($que) OR die(mysql_error());
}
check($username, $set);
if(!isset($username))
if(strlen($_POST['user']) <= 0) {
echo "<p>The username you entered encountered a problem.</p>";
$set = 1;
}
if(strlen($_POST['user']) < 4) {
echo "<p>The username you entered is too short. (4-20 Characters)</p>";
$set = 1;
}
if(strlen($_POST['user']) > 20) {
echo "<p>The username you entered is too long. (4-20 Characters)</p>";
$set = 1;
}
if(!isset($password) || !isset($password2))
if(strlen($_POST['pass']) <= 0 || strlen($_POST['pass2']) <= 0) {
echo "<p>The password's field cannot be left empty.</p>";
$set = 1;
}
if($password != $password2) {
echo "<p>The passwords you entered do not match.</p>";
$set = 1;
}
if(strlen($_POST['pass']) < 8 || strlen($_POST['pass2']) < 8) {
echo "<p>The password you entered is too short. (Min: 8 Characters)</p>";
$set = 1;
}
if(!isset($email)) {
echo "<p>The email you entered encountered a problem.</p>";
$set = 1;
}
if(!isset($checkbox)) {
echo "<p>You must agree to the Terms Of Service before continuing.</p>";
$set = 1;
}
if($set == 1) {
echo "<p><a href='javascript:history.go(-1)'>.: Go Back :.</a></p>";
}
if($username && $password && $password2 && $email && $checkbox && !$set)
{
register($username, $password, $email, $res);
echo "<p>Welcome $username to the community! However, your registration process is not done yet.
Please check the email you provided us at $email for an activation link. Enjoy!</p>";
mysql_close($con);
}
?>
Thank You Again!🙂