<?php
$output = NULL;
$ip = $_SERVER['REMOTE_ADDR'];
if (isset($POST['submit'])) {
$username = $mysqli->real_escape_string($_post['username']);
$password = $mysqli->real_escape_string($_post['password']);
$rpassword = $mysqli->real_escape_string($_post['rpassword']);
$email = $mysqli->real_escape_string($_post['email']);
$query = $mysqli->query("SELECT * FROM users WHERE username = '$username'");
if (empty($username) OR empty($password) OR empty($email) or empty($rpassword)) {
$output = "Please fill in all fields!";
} elseif ($query->num_rows != 0) {
$output = "That username is already taken!";
} elseif ($rpassword != $password) {
$output = "Password does not match!";
}
}
?>
Later on in the script, I use this:
<?php
echo $output;
?>
It does not echo, and yes, I have added the mysqli query, but I removed it for the safety of the database. You can also see that it does not echo at the website: vobern.com