// add the email entered to the list
$TypeString = $_GET['TYPE'];
$EmailString = $_GET['EMAIL'];
$DownloadString = $_GET['DOWNLOAD'];
if($TypeString == "subscribe")
{
// ADD THE EMAIL TO THE DB
if((strpos($EmailString, "@") !== false)&&(strpos($EmailString, ".") !== false))
{
post("sub.ezinedirector.net/index.cfm","fuseaction=s&EzineID=964706733&email=".$EmailString);
}
// display the thank you page
?>
Thank You
Thank you for signing up for our newsletter. If you would like to unsubscribe at any time, please click the "unsubcribe" link in the bottom of your newsletter.
}
else if($TypeString == "subscribeAndDownload")
{
// ADD THE EMAIL TO THE DB
if((strpos($EmailString, "@") !== false)&&(strpos($EmailString, ".") !== false))
{
post("sub.ezinedirector.net/index.cfm","fuseaction=s&EzineID=964706733&email=".$EmailString);
}
// Redirect to the download
header('Location: '.$DownloadString);
}
else if($TypeString == "unsubscribe")
{
// DELETE THE EMAIL FROM THE DB
if((strpos($EmailString, "@") !== false)&&(strpos($EmailString, ".") !== false))
{
post("sub.ezinedirector.net/index.cfm","fuseaction=r&EzineID=964706733&email=".$EmailString);
}
// display the thank you page
?>
We're Sorry
We're sorry you've decided to unsubscribe. You will be able to resubscribe for free at any time.
}
else if($TypeString == "getinfo")
{
// GET THE INFO FROM THE USER (CREATE FORM)
$submitquery = ""
?>
Newsletter Signup
Just fill in your email below to start receiving our free newsletter containing the latest info on our hottest new game releases as well as hints, tips, and cheats to some of your favorite games!
}
else if($TypeString == "removeinfo")
{
// GET THE INFO FROM THE USER TO REMOVE EMAIL (CREATE FORM)
$submitquery = ""
?>
Newsletter Unsubscribe
Just fill in your email below to stop receiving our free newsletter containing the latest info on our hottest new game releases as well as hints, tips, and cheats to some of your favorite games!
}
function post($host,$query,$others='')
{
$path=explode('/',$host);
$host=$path[0];
unset($path[0]);
$path='/'.(implode('/',$path));
$post="POST $path HTTP/1.1\r\nHost: $host\r\nContent-type: application/x-www-form-urlencoded\r\n${others}User-Agent: Mozilla 4.0\r\nContent-length: ".strlen($query)."\r\nConnection: close\r\n\r\n$query";
$h=fsockopen($host,80);
fwrite($h,$post);
for($a=0,$r='';!$a;)
{
$b=fread($h,8192);
$r.=$b;
$a=(($b=='')?1:0);
}
fclose($h);
return $r;
}
?>