Can someone please help me on this. I have posted this for the second time now and since I'm still a pretty new beginner, I can't seem to figure out what part of my scripting is incorrect. I need to have the echo statement show on a blank page, rather than on the same page with the form, after the submit button is pressed. Right now, if I enter in any email address, it shows my echo "blah,balh" on the same page. If anyone can help, I would greatly appreciate someone pointing me in the right direction, other than the manual. It meens nothing to me at this point.
Thanks in advance...
Kyle
Here is my script:
<?php require_once('../Connections/EMALL.php'); ?>
<?php
if ($REQUEST_METHOD=='POST') {
echo "Email Address: $EmailAddress has been Successfully removed from our database.";}
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());
}
?>
<?php
mail($EmailAddress, "AmericanEmall Confirmation", "You have successfully been unsubscribed from our Email database. We are sorry to see you go!!
Please come back and visit us soon.
Sincerely,
NevadaMatters & Associates",
"From: [email]Newsletter@americanemall.com[/email]\r\n".
"Reply-To: [email]Sales@americanemall.com[/email]\r\n".
"Return-Path: [email]sales@americanemall.com[/email]\r\n");
?>
<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>
<? Echo "<p align=\"center\">EmailAddress: <input name=\"EmailAddress\"
type=\"text\" value=\"$EmailAddress\">"?>
</p>
<p align="center">
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<p> </p>
</body>
</html>