cr-hosting
11-11-2004, 09:34 PM
Hi,
I have created a php file, to automatically send an email to my suscribe. Inside theform I have 1 text field and 3 hidden fields, for some reason it is not working correctly.
www.erikprestinary.com is the web site, some sort of help or heads up would be nice.
thanks !
Code below:
<?php
if ($_POST[recipient] && $_POST[subject] && $_POST[redirect]) {
if ($_POST[required]) {
$rfields = explode (",",$_POST[required]);
foreach ($rfields as $check) {
if (!$_POST[$check]) {
header("Location: ".$_POST[errorpage]);
exit();
}
}
}
$ndata = array("recipient","subject","redirect");
while (current($_REQUEST)) {
if (!in_array(key($_REQUEST),$ndata)) $msg .= key($_REQUEST).": ".current($_REQUEST)."\n";
next($_REQUEST);
}
mail($_POST[recipient],$_POST[subject],$msg,"From: $_POST[email]\r\n"."Reply-To: $_POST[email]\r\n");
header("Location: ".$_POST[redirect]);
}
else echo "Recipient, subject or redirect field is missing...";
?>
I have created a php file, to automatically send an email to my suscribe. Inside theform I have 1 text field and 3 hidden fields, for some reason it is not working correctly.
www.erikprestinary.com is the web site, some sort of help or heads up would be nice.
thanks !
Code below:
<?php
if ($_POST[recipient] && $_POST[subject] && $_POST[redirect]) {
if ($_POST[required]) {
$rfields = explode (",",$_POST[required]);
foreach ($rfields as $check) {
if (!$_POST[$check]) {
header("Location: ".$_POST[errorpage]);
exit();
}
}
}
$ndata = array("recipient","subject","redirect");
while (current($_REQUEST)) {
if (!in_array(key($_REQUEST),$ndata)) $msg .= key($_REQUEST).": ".current($_REQUEST)."\n";
next($_REQUEST);
}
mail($_POST[recipient],$_POST[subject],$msg,"From: $_POST[email]\r\n"."Reply-To: $_POST[email]\r\n");
header("Location: ".$_POST[redirect]);
}
else echo "Recipient, subject or redirect field is missing...";
?>
