Does anyone know how to convert an html input type to php. What I'm trying to do is when a member clicks on a link to go to a page, it inserts their email address into the field without them having to type it in manually. Basically just like if you go to unsubscribe from a mail list, you click on the link in the email and it puts your email address into the emailaddress field. Please help...
My Script:
<?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">EmailAddress: <input name="EmailAddress" type="text" value="EmailAddress" size="80" maxlength="120">
</p>
<p align="center">
<input type="submit" name="Submit" value="Submit">
</p>
</form>
<p> </p>
</body>
</html>
😕