Hi, I've got an email script that works (which I am disgustingly proud about), which some kind people on here helped me with, and I fixed a bit too. However, there's still an excellent reason I'm posting in the Newbies section.... It all works except one or two bits.
What I want to happen is that the user puts in their email address: <input type="text" name="email" value="<? echo $_POST[email]; ?>"> which then replaces my own with theirs using the headers function..... I think this is possible, I remember a tutorial that said it was.... However, I think I've done it wrong somehow, I tried to set the headers to use the email variable that I tried to set with the text input field (above in red), but I'm pretty sure that's not how you do it. Can anyone help???
Just to confirm:
The user puts in a message ->
Then their email address ->
My script replaces the email address my server uses for outgoing mail using headers with the address the user input so I can reply to them (or it appears that way, I don't actually want to use a different one!)
-> I am inordinately happy and get too enthusiastic and break the script again.
<?
if (isset($_POST['Send'])) {
$to = 'order@bluewolfmedia.co.uk';
ini_set("sendmail_from", " weaselandalf@yahoo.co.uk ");
$subject = 'A new client';
$body= $_POST['message'];
mail($to,$subject,$body,$from);
echo "Thanks for your email";
} else {
$headers .= 'From: Client $email'.$eol;
$headers .= 'Reply-To: Client $email'.$eol;
$headers .= 'Return-Path: Client $email'.$eol;
?>
<form action="<? $PHP_SELF; ?>" method="post">
<textarea name="message" value="<? echo $POST['message']; ?>"></textarea>
<input type="text" name="email" value="<? echo $POST[email]; ?>">
<input type="submit" name="Send" value="Send">
</form>
<? } ?>
Can anyone either help or find me a psychologist??