Forum Moderators: coopster

Message Too Old, No Replies

Desperate. Form email sends blank page

First attempt at using php to process form

         

ksponline

2:28 am on Jul 16, 2003 (gmt 0)

10+ Year Member



Hi,

I've made my first attempt at a php-based form at work in order to personalize the form response with the submitter's name; I'm desperate to have this working by morning. When I submit the form, all that's returned to me is a blank page. I've been searching Google but can't figure out what I've done wrong or what I'm not understanding about processing and e-mailing form information. The php to process the form is this:

<?php
mail("me@mydomain.com","Subject of Form","$message","From: $name <$email>");
foreach($HTTP_POST_VARS as $key => $value)
{
$message .= $key . ": " . $value;
$message .= "\n";
}
echo "Thank you for your submission, $name.<br>
<p>Sincerely,<br>
Company Name</p>"
?>

</body>
</html>

Is my problem with the $HTTP_POST_VARS section; have I misunderstood what that can do (read the inputs from the form)?

The form on the html page is generally configured as such, and there are about 20 input values:

<td colspan="2" align="left" valign="bottom">Your
Name<br>
<input name="name" type="text" id="name" size="60"> <br>
</td>
<td width="50%"> </td>

I appreciate any help or insight to solve this problem...

Thank you...

PS In case it makes any difference, my host adds this to outgoing messages:

X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - xxx.hostdomain.net
X-AntiAbuse: Original Domain - domain.net
X-AntiAbuse: Originator/Caller UID/GID - [99 99] / [99 99]
X-AntiAbuse: Sender Address Domain - xxx.hostdomain.net

ksponline

4:18 am on Jul 16, 2003 (gmt 0)

10+ Year Member



Nevermind, problem solved. I just had to move:

foreach($HTTP_POST_VARS as $key => $value)
{
$message .= $key . ": " . $value;
$message .= "\n";
}

so that it was above the mail() function.

Shadi

3:56 pm on Jul 16, 2003 (gmt 0)

10+ Year Member



it took you two hours to debug that? ;) happens to the best of us :D

ksponline

5:18 pm on Jul 16, 2003 (gmt 0)

10+ Year Member



I probably shouldn't 'fess' up to this, but worst than that, I still didn't find it on my own! :()

I tend to focus on one part (i.e., HTTP_POST_VARS in this case) and not look at the overall picture...so this was an important lesson.