giggles2460 Posted February 4, 2011 Share Posted February 4, 2011 I'm hoping for some help, but I've asked a few friends that seem to know some PHP basics (I'm just learning, but I've tried everything that I can think of). I designed a website using Dreamweaver and all that's left to do is write some PHP script to send the information submitted online on my form to my email. (Yes, my server supports PHP) The way I have it now, I fill out the form, click submit, and then I receive an email, but the email is blank. I've tried REQUEST, POST, and GET all to no avail. I have no idea what I'm doing incorrectly!Here is my form:<form id="Feedback" name="Feedback" method="post" action="sendmailfeedback.php"> <table width="460"> <tr> <td width="181" height="31" align="right" valign="top"><label for="CustomerName">Name:</label></td> <td width="267" valign="top"><input name="CustomerName" type="text" id="CustomerName" size="30" /></td> </tr> <tr> <td height="31" align="right" valign="top"><label for="CustomerEmail">Email Address:</label></td> <td valign="top"><input name="CustomerEmail" type="text" id="CustomerEmail" size="30" /></td> </tr> <tr> <td height="31" align="right" valign="top"><label for="CustomerPhone">Phone Number:</label></td> <td valign="top"><input name="CustomerPhone" type="text" id="CustomerPhone" size="30" /></td> </tr> <tr> <td align="right" valign="top"><label for="CustomerComments">Questions or Comments:</label></td> <td valign="top"><textarea name="CustomerComments" cols="30" rows="5" id="CustomerComments"></textarea></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td colspan="2"><div align="center"> <input name="SubmitButton" type="submit" class="style2" id="SubmitButton" value="Submit" /> </div></td> </tr> </table> </form>Here is my PHP script (sendmailfeedback.php)<?php $CustomerName = $_REQUEST['CustomerName'] ; $CustomerEmail = $_REQUEST['CustomerEmail'] ; $CustomerPhone = $_REQUEST['CustomerPhone'] ; $CustomerComments = $_REQUEST['CustomerComments'] ; mail( "erika.bland@gmail.com", "Feedback Form Results", $message, "From: $CustomerEmail" ); header( "Location: http://erikabland.net16.net/ContactUs/cont...kyou.html" );?>I have the site uploaded to a free hosting server at the moment (that also supports PHP):http://erikabland.net16.netany help is greatly appreciated!! I think I've been reading/watching so many tutorials lately on PHP forms that I'm beyond confused at this point. Link to comment Share on other sites More sharing options...
giggles2460 Posted February 4, 2011 Author Share Posted February 4, 2011 Ooops, I meant for that to be a link to the form page:http://erikabland.net16.net/ContactUs/contact_feedback.html Link to comment Share on other sites More sharing options...
justsomeguy Posted February 4, 2011 Share Posted February 4, 2011 You can use either $_POST or $_REQUEST for that form, but the problem is that you're not defining $message. You told it to use $message as the body, but you didn't tell it what $message is. You can use the string concatenation operator to build the body:http://www.w3schools.com/php/php_string.asp Link to comment Share on other sites More sharing options...
giggles2460 Posted February 4, 2011 Author Share Posted February 4, 2011 You can use either $_POST or $_REQUEST for that form, but the problem is that you're not defining $message. You told it to use $message as the body, but you didn't tell it what $message is. You can use the string concatenation operator to build the body:http://www.w3schools.com/php/php_string.asp Thank you for your help!! I'll get right on it! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.