crj900 Posted October 22, 2007 Share Posted October 22, 2007 OK. I am not a programmer, i know very little about .php. I have used EVERY contact form generator on the internet it seems, nothing has worked. Could someone please tell me why this isnt working. The first quote is the .html file, and the 2nd one is the.php. The "contact.php" is replace with the correct URL when uploading. <!-- Website Contact Form Generator --> <!-- http://www.tele-pro.co.uk/scripts/contact_form/ --> <!-- This script is free to use as long as you --> <!-- retain the credit link --> <form method="POST" action="contact.php"> Fields marked (*) are required <p>Email From:* <br> <input type="text" name="EmailFrom"> <p>FT:<br> <input type="text" name="FT"> <p>pt:<br> <input type="text" name="pt"> <p>summer:<br> <input type="text" name="summer"> <p>transporters:<br> <input type="text" name="transporters"> <p>overnights:<br> <input type="text" name="overnights"> <p>swaddlingnewcare:<br> <input type="text" name="swaddlingnewcare"> <p>nany:<br> <input type="text" name="nany"> <p>temp:<br> <input type="text" name="temp"> <p>parentsname:<br> <input type="text" name="parentsname"> <p>address:<br> <input type="text" name="address"> <p>livein:<br> <input type="text" name="livein"> <p>cell:<br> <input type="text" name="cell"> <p>homephone:<br> <input type="text" name="homephone"> <p><input type="submit" name="submit" value="Submit"> </form> <p> <!-- Contact Form credit link --> Created by <a target="_blank" href="http://www.tele-pro.co.uk/scripts/contact_form/">Contact Form Generator</a> <?php // Website Contact Form Generator // http://www.tele-pro.co.uk/scripts/contact_form/ // This script is free to use as long as you // retain the credit link // get posted data into local variables $EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); $EmailTo = "chrisj900@hotmail.com"; $Subject = "Customer"; $FT = Trim(stripslashes($_POST['FT'])); $pt = Trim(stripslashes($_POST['pt'])); $summer = Trim(stripslashes($_POST['summer'])); $transporters = Trim(stripslashes($_POST['transporters'])); $overnights = Trim(stripslashes($_POST['overnights'])); $swaddlingnewcare = Trim(stripslashes($_POST['swaddlingnewcare'])); $nany = Trim(stripslashes($_POST['nany'])); $temp = Trim(stripslashes($_POST['temp'])); $parentsname = Trim(stripslashes($_POST['parentsname'])); $address = Trim(stripslashes($_POST['address'])); $livein = Trim(stripslashes($_POST['livein'])); $cell = Trim(stripslashes($_POST['cell'])); $homephone = Trim(stripslashes($_POST['homephone'])); // validation $validationOK=true; if (Trim($EmailFrom)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; exit; } // prepare email body text $Body = ""; $Body .= "FT: "; $Body .= $FT; $Body .= "\n"; $Body .= "pt: "; $Body .= $pt; $Body .= "\n"; $Body .= "summer: "; $Body .= $summer; $Body .= "\n"; $Body .= "transporters: "; $Body .= $transporters; $Body .= "\n"; $Body .= "overnights: "; $Body .= $overnights; $Body .= "\n"; $Body .= "swaddlingnewcare: "; $Body .= $swaddlingnewcare; $Body .= "\n"; $Body .= "nany: "; $Body .= $nany; $Body .= "\n"; $Body .= "temp: "; $Body .= $temp; $Body .= "\n"; $Body .= "parentsname: "; $Body .= $parentsname; $Body .= "\n"; $Body .= "address: "; $Body .= $address; $Body .= "\n"; $Body .= "livein: "; $Body .= $livein; $Body .= "\n"; $Body .= "cell: "; $Body .= $cell; $Body .= "\n"; $Body .= "homephone: "; $Body .= $homephone; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/ Share on other sites More sharing options...
le007 Posted October 22, 2007 Share Posted October 22, 2007 Whats not working with it? Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-375742 Share on other sites More sharing options...
crj900 Posted October 23, 2007 Author Share Posted October 23, 2007 It wont send me back an email when the submit button is pressed. Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-375877 Share on other sites More sharing options...
AndyB Posted October 23, 2007 Share Posted October 23, 2007 It wont send me back an email when the submit button is pressed. Do you mean that: a: nothing happens b: the 'error' page loads c: you do not receive the email If c is the problem, what happens when you use a proper domain email address rather then a hotmail address as the receiving address, and what happens when you use a 'from' email address that corresponds to the domain where this form resides? Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-375880 Share on other sites More sharing options...
crj900 Posted October 23, 2007 Author Share Posted October 23, 2007 are you saying I have to use an email address that corresponds with the site? I did not know this, and its worked other wise in the past. I'll try it. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-376149 Share on other sites More sharing options...
thebadbad Posted October 23, 2007 Share Posted October 23, 2007 Another thing, what's with all the open p tags in the HTML code? They need to be closed: <p>Text here</p> And the input tags should be closed within the opening tag, like this: <input type="text" name="name" /> I'm not sure if this could have anything to do with the mail not arriving, but you should correct the code either way. Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-376156 Share on other sites More sharing options...
chocopi Posted October 23, 2007 Share Posted October 23, 2007 Is it because your not actually sending the email you are just storing it in a variable shouldn't it be: mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); instead of $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); ~ Chocopi Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-376167 Share on other sites More sharing options...
otuatail Posted October 23, 2007 Share Posted October 23, 2007 No $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); should work but you might add this before mail() ini_set("sendmail_from", "root@mywebsite.co.uk"); Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-376174 Share on other sites More sharing options...
Ninjakreborn Posted October 23, 2007 Share Posted October 23, 2007 Since you don't know php, what fields are you wanting in your form? Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-376179 Share on other sites More sharing options...
crj900 Posted October 23, 2007 Author Share Posted October 23, 2007 just txt fields, check boxes, and txt areas. I put this together using http://www.tele-pro.co.uk/scripts/contact_form/ Its gotten great reviews so I was going crazy trying to figure out why it wasn't working for me. I'm going to go ahead and try these changes, I'll get back to you all in an hour or so. Thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-376221 Share on other sites More sharing options...
crj900 Posted October 23, 2007 Author Share Posted October 23, 2007 Could someone try that site out, and try to make their own contact form. I have no idea what I am doing wrong, I have put about 10 hours into this already. I changed the email address, and this still did not work. I changed to chris@chrisjenkinsinc.com, and the site im uploading it to is chrisjenkinsinc.com Please help, I am willing to pay at this point via paypal. Thanks. :'( Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-376288 Share on other sites More sharing options...
otuatail Posted October 23, 2007 Share Posted October 23, 2007 Try \r\n on the end of the <....> can cause problems $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>\r\n"); Desmond. Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-376296 Share on other sites More sharing options...
crj900 Posted October 23, 2007 Author Share Posted October 23, 2007 That also did not work. I am hosting with yahoo, so I know they accept php. Any other ideas? ??? ??? Quote Link to comment https://forums.phpfreaks.com/topic/74367-somebody-please-help-me-with-this-contact-form-its-driving-me-crazy/#findComment-376338 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.