Can anyone help me. I can't seem to get my script to call the "echo" statement on a blank page, once the form is submitted. It wants to show the "Echo" on the same page with the form. What did I do wrong. Below is a copy of my script: Please help me. I would greatly appreciate it...🙁
<?php require_once('../Connections/EMALL.php'); ?>
<?php
if ($REQUEST_METHOD=='POST') {
echo "An email has been sent.";}
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
if ((isset($HTTP_POST_VARS['EmailAddress'])) && ($HTTP_POST_VARS['EmailAddress'] != "")) {
$deleteSQL = sprintf("DELETE FROM Emailcollector WHERE `Email Address`=%s",
GetSQLValueString($HTTP_POST_VARS['EmailAddress'], "text"));
mysql_select_db($database_EMALL, $EMALL);
$Result1 = mysql_query($deleteSQL, $EMALL) or die(mysql_error());
}
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p align="center">[url]www.AmericanEmall.com[/url] </p>
<p align="center">(Email Database)</p>
<form action="" method="post" name="Unsubscribe" id="Unsubscribe">
<p align="center">To unsubscribe from our Email Database, please type in your
email address and then click the "Submit: button. You will be completely
deleted from our database. </p>
<p align="center">Email Address:
<input name="$EmailAddress" type="text" id="$EmailAddress">
</p>
<p align="center">
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<p> </p>
</body>
</html>