
December 10th, 2004, 08:30 PM
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 22,309
Time spent in forums: < 1 sec
Reputation Power: 25
|
|
|
RE: Help with PHP FORM - im a n00b.
Here is the new code mixed with the HTML form... please let me know what im doing wrong... I am still having trouble... My first problem is when receiving the email it takes superrrrrrr long. (delayed about 3-4hrs.) second problem it still will not output the correct information in the email... still comes in blank.  please help !!!
Here is the TEST page here: http://www.total-nutrition1.com/contact2.php
php Code:
Original
- php Code |
|
|
|
<?php if ($_SERVER['REQUEST_METHOD'] != 'POST'){ $me = $_SERVER['PHP_SELF']; ?> <form name="form1" method="post" action="<?php echo $me;?>"> <div align="center"> <b> To better assist you,<br> please fill in the area(s) below:<br> </b><br> <table width="270" border="0" cellspacing="1" cellpadding="0"> <tr> <td align="right">Name:</td> <td><input type="text" name="name" size="28"></td> </tr> <tr> <td align="right">Address:</td> <td><input type="text" name="address" size="28"></td> </tr> <tr> <td align="right">City:</td> <td><input type="text" name="city" size="28"></td> </tr> <tr> <td align="right">State:</td> <td><input type="text" name="state" size="5"> Zip:<input type="text" name="zip" size="11"></td> </tr> <tr> <td align= "right">E- Mail:</td> <td><input type="text" name="emailAddress" size="28"></td> </tr> <tr> <td align="right">Select One:</td> <td></td> </tr> <tr> <td valign="top"></td> <td> <div align="left"> <input type="radio" name="radiobutton" value="ordering" checked>Ordering<br> <input type="radio" name="radiobutton" value="comments">Comment(s)<br> <input type="radio" name="radiobutton" value="shipping">Shipping<br> <input type="radio" name="radiobutton" value="general">General<br> <input type="radio" name="radiobutton" value="catalog">Catalog Request</div> </td> </tr> <tr> <td align="right" valign="top">Comments:</td> <td></td> </tr> <tr> <td valign="top"></td> <td><textarea name="comments" rows="8" cols="30"></textarea></td> </tr> </table> </div> <div align="center"> <p><input type="submit" name="Submit" value="Submit"> <input type="reset" value="Clear Form" name="reset"></p> </div> </form> <?php } else { $recipient = "jay-peezee@sbcglobal.net"; $subject = "Inquiry about " . $_POST["radiobutton"]; $msg .= $_POST["name"] . "n"; $msg .= $_POST["address"] . "n"; $msg .= $_POST["city"] . ", " . $_POST["state"] . ", " . $_POST["zip"] . "n"; $msg .= $_POST["comments"] . "n"; $from = $_POST["emailAddress"]; if (mail($recipient, $subject, $msg, $from)) echo nl2br("<br><center><b>Your Inquiry has been received.<br>Thank You !</b></center>"); else echo "Message failed to send"; } ?>
|