Hi There,
Im currently writing some code that allows people to sign up for a newsletter, and get directed to another page.
Im quite stuck, as my codes not working, and I really have no idea what to do (Im just a beginner).
Heres my code, most of it works fine, its the redirection that I cant get working.
Any suggestions?
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $SERVER["SERVER_NAME"].":".$SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $SERVER["SERVER_NAME"].$SERVER["REQUEST_URI"];
}
return $pageURL;
}
if($_POST['action']=="news")
{
$name = $_POST['name'];
$email = $_POST['email'];
$today = date("F j, Y, g:i a");
$value = $_POST['send'];
$link = curPageURL();
$message = "
Newsletter Signup Received:
Date: $today
Name: $name
Email: $email
Page they signed up on: $link
";
{
mail($SESSION['ext'],$SESSION['sitename'].' :: Newsletter Signup',$message,"From:".$_REQUEST['email']."\n"."Bcc:".$BCCMAIL."\n"."Content-type: text/html; charset=iso-8859-1\n"."X-Mailer: PHP 5.x");
}
header("Location:index.php");
}
Cheers
Anniebelle