When I have the form going to a script, the form information returns via email correctly. Although how can I make the original form entries go the original html file?
I have tried changing the form to a php file with the script code included and although an email is sent, this is without the information I want?
Basically I want the script to "intercept" the change between the form and it's destination, in turn emailing me the information.
The script information I'm using is as follows:
(note:$HTTP_REFERER is in the MailFromAddress so I can identify the client making the change)
<?
$MailToAddress = "destination@mydomain.com";
$MailSubject = "Client Password Change";
if (!$MailFromAddress) {
$MailFromAddress = "$HTTP_REFERER";
}
$Header = "";
$Footer = "";
?>
<?
if (!is_array($HTTP_POST_VARS))
return;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
$val=stripslashes($val);
echo "<b>$key</b> = $val<br>";
$Message .= "$key = $val\n";
}
if ($Header) {
$Message = $Header."\n\n".$Message;
}
if ($Footer) {
$Message .= "\n\n".$Footer;
}
mail( "$MailToAddress", "$MailSubject", "$Message", "From: $MailFromAddress");
?>
Any help is very much appreciated, I'm completely new to php, but I'm sure the solution I'm looking for is with this code!
Andrew