-3
The code lowers checks if the user’s ip is already registered in the database, but it keeps sending the information that the ip is free, even though it is already registered in the database.
$ip = $_SERVER["REMOTE_ADDR"];
$query = mysql_query("SELECT ip FROM emails WHERE ip = '$ip'");
$countUser = mysql_num_rows($query);
if($countUser > 0){
while($row = mysql_fetch_array($query)){
echo "IP já registrado";
}
} else {
echo "IP livre";
}