Dr. Sarf
11-12-2007, 04:08 PM
Hi all, hope you can help, I really don't know a thing about PHP but I do have a working feedback form that simply submits to the following PHP script:
<p align="center"> </p><script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "myemail@mydomain.com";
$mailsubj = "Any Subject";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>
This works fine but I want to somehow integrate a function that allows users to put their email address in a field on the form (easy) and for the form contents to then be emailed to that address, as well as the one defined in the $mailto part of the script.
I've no idea how to modify the script so it calls from the field containing the email address the user puts in, and then emails the contents to them?
I'd really appreciate any help on this.
Thanks
Mat
<p align="center"> </p><script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "myemail@mydomain.com";
$mailsubj = "Any Subject";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>
This works fine but I want to somehow integrate a function that allows users to put their email address in a field on the form (easy) and for the form contents to then be emailed to that address, as well as the one defined in the $mailto part of the script.
I've no idea how to modify the script so it calls from the field containing the email address the user puts in, and then emails the contents to them?
I'd really appreciate any help on this.
Thanks
Mat

