PHP email input form - having trouble getting the form to work... - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21) +---- Thread: PHP email input form - having trouble getting the form to work... (/showthread.php?tid=25143) |
PHP email input form - having trouble getting the form to work... - abayindi - 02-13-2012 I created a php form to capture an email address, then i want to send the email address i captured to my email (hidden in this code). I'm getting the following error and not sure why... "No input file specified." I tried to rename forms, id's, i'm new to php so not really sure what i'm missing. Please help, thanks. Here is the PHP form code process: page name is: contactformprocess.php ----------------------------------------------------------------- <? php /*subject line and email veriables */ $emailSubject = 'crazy php script!'; $webMaster = '[email address is hidden for stackoverflow]'; /*gathing data vaiables */ $emailField = $_POST['FormName']; $body = <<<EOD <br><hr><br> Email: $textfieldName <br> EOD; $headers = "From: $FormName\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail ($webMaster, $emailSubject, $body, $headers); /* Results rentered as html */ $theResults = <<<EOD <html> <head> <title>JakesWorks - travel made easy-Homepage</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { background-color: #f1f1f1; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: normal; color: #666666; text-decoration: none; } --> </style> </head> <div> <div align="left">Thank you for your interest! Your email will be answered very soon!</div> </div> </body> </html> EOD; echo "$theResults"; ?> The FORM code is here: html page ----------------------------------------------------------- <form id="newsletteremail" class="form" method="post" action="contactformprocess.php"> <span class="newsletter">Monthly Newsletter Signup</span><br> <span class="text1_off">Subscribe and be the first to know.<br> </span><span class="text1_off"><br> <table width="190" border="0" cellspacing="0" cellpadding="0"> <tr> <td><input class="newletter_box" type="text" name="newsletteremail" value=" Enter your e-mail" size="16"></td> <td></td> <td align="right"><a onmouseover="changeImages('submit_off','images/submit_over.gif');return true" onmouseout="changeImages('submit_off','images/submit_off.gif');return true" href="contactformpage.php"><img id="submit_off" src="images/submit_off.gif" alt="" name="newsletteremail" height="24" width="60" border="0"></a></td> </tr> </table> </span> </form> RE: PHP email input form - having trouble getting the form to work... - BreShiE - 02-13-2012 Take a look at some available online scripts, compare them with yours and then try to figure out what's going wrong. http://phpeasystep.com/phptu/8.html http://www.freecontactform.com/email_form.php http://myphpform.com/final-form.php http://php.about.com/od/phpapplications/ss/form_mail.htm RE: PHP email input form - having trouble getting the form to work... - TalishHF - 02-14-2012 Breshie, why lie? You didn't create this form at all, if you created it you would know why it doesn't work. You copied the code. RE: PHP email input form - having trouble getting the form to work... - AceInfinity - 02-14-2012 (02-14-2012, 08:28 AM)TalishHF Wrote: Breshie, why lie? You didn't create this form at all, if you created it you would know why it doesn't work. Who said he he did? BreShie Wrote:Take a look at some available online scripts PHP Code: $_POST['FormName']; I don't see a "FormName" id anywhere in the form html. Code: Email: $textfieldName $textfieldName is undefined previously in the php code from what you've posted. I see in the form code: - newsletteremail - newsletteremail And NO submit input. RE: PHP email input form - having trouble getting the form to work... - RainbowDashFTW - 03-19-2012 $emailField = $_POST['FormName']; Don't you mean $emailField = $_POST['newsletteremail]; ? |