<?PHP
include ("admin/config.inc.php");
$connessione = @mysql_connect(
$db_host,
$db_user,
$db_password
)
or die
("Non č possibile connettersi!!!");
$db = @mysql_select_db($db_name,$connessione);
$sql = "SELECT * FROM mailing WHERE mail = '$email' ";
$query = @mysql_query ($sql, $connessione);
$num_mail = mysql_num_rows($query);
if ($num_mail == "0") {
$sql = "INSERT INTO mailing (mail,ip) VALUES ('$email', '$REMOTE_ADDR')";
$query = @mysql_query ($sql, $connessione);
echo "<div align='center'><font face='Arial' size='2' color='#000000'>Email inserita correttamente!</font></div>";
echo "<META HTTP-EQUIV=REFRESH CONTENT='1; URL=./'>";
}
else {
echo "<div align='center'><font face='Arial' size='2' color='#000000'>Email giā presente del database!</font></div>";
echo "<META HTTP-EQUIV=REFRESH CONTENT='2; URL=./'>";
}
@mysql_close ($connessione);
?>