Re: Forms not parsing data
| From: | jeffrey_n_Dyke at Keane dot com | Date: | Wed, 21 Apr 2004 20:15:53 +0000 |
| Subject: | Re: Forms not parsing data | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-13306@lists.php.net to get a copy of this message | ||
I believe that you must seperate all headers with a \r\n, well that is per
the RFC, but i also understand that your method, or at least just with a
single \n will work. I would start to remove the extra headers argument
and see if that is your problem. If you can mail with no extra headers try
rebuilding them with \r\n. Personally, i've NEVER been able to send
without \r\n ending each header.
HTH
Jeff
So, I've installed PHP 4.3.6 and done "make test" and everything runs
fine. But now, when I run the scripts below, nothing happens. Actually, I
get an email with no returned values. This is a very common problem, but
nothing I've read can fix it. FYI, I have my register_globals set to the
default of off. I know it has to be something in the settings that's
causing
this, but I don't know what it could be. TIA.
INDEX.PHP----------------------------------
<form action="hello.php" method="POST">
Your first name <input type="text" name="name">
Your favorite color <input type="text" name="color">
Your email address <input type="text" name="email">
<input type="submit" value="Send Info">
</form>
HELLO.PHP-------------------------------
<?php
$senderemail = $_POST['email'];
$sendername = $_POST['name'];
$sendercolor = $_POST['color'];
$recipient = "test@example.com";
$subject = "Your subject line goes here";
$mailheader = "From: $senderemail\n";
$mailheader .= "Reply-To: $senderemail\n\n";
$message = "Sender's name: $sendername\n";
$message .= "Sender's favorite color: $sendercolor\n\n";
mail($recipient, $subject, $message, $mailheader) or die ("Failure");
?>
_________________________________________________________________
Watch LIVE baseball games on your computer with MLB.TV, included with MSN
Premium!
http://join.msn.com/?page=features/mlb&pgmarket=en-us/go/onm00200439ave/direct/01/