1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| $FX_flag = "MM_insert";
$FX_found = false;
if (isset($HTTP_POST_VARS[$FX_flag]))
{
$FX_dupKeyRedirect = "subscribe.php";
$FX_dupKeyValue = $HTTP_POST_VARS["email"];
$FX_dupKeySQL = "SELECT SubEmail FROM subs WHERE SubEmail = '" . $FX_dupKeyValue . "'";
mysql_select_db($database_bbb, $bbb);
$FX_rsKey=mysql_query($FX_dupKeySQL, $bbb) or die(mysql_error());
if(mysql_num_rows($FX_rsKey) > 0)
{
// this value was found - can not execute action
$FX_found = true;
$FX_dupValue = "email (" . $FX_dupKeyValue . ") ";
}
if($FX_found)
{
$FX_dupValue .= "; ce mail existe déjà !";
$FX_qsChar = "?";
if ($FX_dupKeyRedirect == "")
$FX_dupKeyRedirect = substr($HTTP_SERVER_VARS["PHP_SELF"], strrpos($HTTP_SERVER_VARS["PHP_SELF"], "/")+1);
if (strpos($FX_dupKeyRedirect, "?"))
$FX_qsChar = "&";
$FX_dupKeyRedirect = $FX_dupKeyRedirect . $FX_qsChar . "FX_ReqValue=" . urlencode($FX_dupValue);
header ("Location: " . $FX_dupKeyRedirect);
exit;
} |