I have a registration form using php to process it and store values in
MySQL. That works. But I also would like to get a mail with each
registration input into the database. Anyone with any tip on where to
add this code in the insert-script? At the very beginning, in the
middle, or at the end? And will this piece of code actually mail me
each input? I can't get it to work.
if (phpversion() "4.0.6") {
$HTTP_POST_VARS = &$_POST;
}
if (isset($HTTP_PO ST_VARS["tipsViaEpo st"])) {
// make email info
$to =
"my_first_email @something.com, my_second_email @somethingelse. com";
$subject = "New registration";
$from = "From: Registration DB\r\n";
$body = "Details stored in db:-\n\n";
while (list($key,$val ue) == each($HTTP_POST _VARS)) {
$body.= $key . " = " . $value . "\n";
}
// now send the mail
mail($to,$subje ct,$body,$from) ;
// then redirect to another page
header("Locatio n: registrationSen t.php");
}
MySQL. That works. But I also would like to get a mail with each
registration input into the database. Anyone with any tip on where to
add this code in the insert-script? At the very beginning, in the
middle, or at the end? And will this piece of code actually mail me
each input? I can't get it to work.
if (phpversion() "4.0.6") {
$HTTP_POST_VARS = &$_POST;
}
if (isset($HTTP_PO ST_VARS["tipsViaEpo st"])) {
// make email info
$to =
"my_first_email @something.com, my_second_email @somethingelse. com";
$subject = "New registration";
$from = "From: Registration DB\r\n";
$body = "Details stored in db:-\n\n";
while (list($key,$val ue) == each($HTTP_POST _VARS)) {
$body.= $key . " = " . $value . "\n";
}
// now send the mail
mail($to,$subje ct,$body,$from) ;
// then redirect to another page
header("Locatio n: registrationSen t.php");
}
Comment