Your code contains WHERE Email='$Email' AND IP='$ip'";
yet in a comment
you wrote:
"$Email=$_POST['email']; from submission form, and the IP comes from code: $IP = $_SERVER["REMOTE_ADDR"]; which is at the top of this scripts page"
You're using $IP = $_SERVER["REMOTE_ADDR"];
where you should either be using
$ip = $_SERVER["REMOTE_ADDR"];
or WHERE Email='$Email' AND IP='$IP'";
$IP
and $ip
are NOT the same thing, they're "two different animals altogether" ---
Variables are case-sensitive.
Sidenote:
You can use OR
instead of AND
that way, if someone tries to sign up with a different email but the same IP (and vice-versa), then they won't be able to.
Footnotes:
mysql_*
functions deprecation notice:
http://www.php.net/manual/en/intro.mysql.php
This extension is deprecated as of PHP 5.5.0, and is not recommended for writing new code as it will be removed in the future. Instead, either the mysqli or PDO_MySQL extension should be used. See also the MySQL API Overview for further help while choosing a MySQL API.
These functions allow you to access MySQL database servers. More information about MySQL can be found at » http://www.mysql.com/.
Documentation for MySQL can be found at » http://dev.mysql.com/doc/.