mrchetsteadman Posted April 15, 2010 Share Posted April 15, 2010 Im tryin to get this contact form to send me an email but I can't figure this one out. Here is the code: <div id="contact" class="rounded-10"> <form action="" method="post" id=""> <h3>Send us an Email</h3> <fieldset> <ol> <li> <label for="name" class="name">Your Name</label> <input type="text" name="name" id="name" value="" class="required" /> </li> <li> <label for="email" class="name">Your Email</label> <input type="text" name="email" id="email" value="" class="required email" /> </li> <li> <label for="message" class="name">Your Message</label> <textarea name="message" id="message" class="required" rows="" cols=""></textarea> </li> <li> <label for="submit" class="name"> </label> <input type="submit" id="submit" value="Submit" /> <input type="hidden" name="submitted" id="submitted" value="true" /> </li> </ol> </fieldset> </form> <div id="sent"> <h3>Your message has been sent!</h3> <p>We'll be in touch soon.</p> </div> I feel like it's one of those SIMPLE things that I am overlooking. Im not a coder at all so be easy on me. :D Link to comment Share on other sites More sharing options...
0 boogerjones Posted April 15, 2010 Share Posted April 15, 2010 Sooooooo, what's the problem? :huh: Link to comment Share on other sites More sharing options...
0 Andy P. Posted April 15, 2010 Share Posted April 15, 2010 There's no form action? Im tryin to get this contact form to send me an email but I can't figure this one out. Here is the code: <div id="contact" class="rounded-10"> <form action="" method="post" id=""> <h3>Send us an Email</h3> <fieldset> <ol> <li> <label for="name" class="name">Your Name</label> <input type="text" name="name" id="name" value="" class="required" /> </li> <li> <label for="email" class="name">Your Email</label> <input type="text" name="email" id="email" value="" class="required email" /> </li> <li> <label for="message" class="name">Your Message</label> <textarea name="message" id="message" class="required" rows="" cols=""></textarea> </li> <li> <label for="submit" class="name"> </label> <input type="submit" id="submit" value="Submit" /> <input type="hidden" name="submitted" id="submitted" value="true" /> </li> </ol> </fieldset> </form> <div id="sent"> <h3>Your message has been sent!</h3> <p>We'll be in touch soon.</p> </div> I feel like it's one of those SIMPLE things that I am overlooking. Im not a coder at all so be easy on me. :D Link to comment Share on other sites More sharing options...
0 mrchetsteadman Posted April 15, 2010 Author Share Posted April 15, 2010 This is the only part I cant figure out so I was gonna erase it but figured it can be useful. This is literally among the last things I have to do before launch. I can scrap it and launch, or I can figure it out. What am I missing? Help me people!!! There's no form action? It was a web address there. What should I put? Link to comment Share on other sites More sharing options...
0 Brewzzin Posted April 15, 2010 Share Posted April 15, 2010 The action needs to point to the file that has the server side script processing the form. Be it PHP, ASP, etc. Link to comment Share on other sites More sharing options...
0 mrchetsteadman Posted April 15, 2010 Author Share Posted April 15, 2010 The action needs to point to the file that has the server side script processing the form. Be it PHP, ASP, etc. :blink: Uh, yeah... Don't seem to be able to find that file. Link to comment Share on other sites More sharing options...
0 Cupcakes Posted April 15, 2010 Share Posted April 15, 2010 You need to have a script that's going to initiate the sending of the form. Just putting in a bunch of form inputs will not magically do this for you. You would have had to created a "form.php" (example filename) containing PHP functions, arrays, yadda yadda that will actually send the mail to you when the submit button is clicked. What you have is the frontend code and none of the backend code. Check out the following link to see what you need to do: PHP Form Mail Meta header and JavaScript injection protection Tags stripped and whitespace trimmed Validity and length checking on name and e-mail fields IP and browser details included in e-mail Valid data displayed when other errors occur Spam word check Common spam bot blocking New in v2: Bayesian style spam filtering A little code snippet: if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isBot()) exit("Bots not allowed.</p>"); function clean($data) { $data = trim(stripslashes(strip_tags($data))); return $data; } She also has a small tutorial if you'd like to read through what all of it means: http://www.tutorialtastic.co.uk/tutorial/php_mail_form_secure_and_protected Link to comment Share on other sites More sharing options...
0 mrchetsteadman Posted April 15, 2010 Author Share Posted April 15, 2010 You need to have a script that's going to initiate the sending of the form. Just putting in a bunch of form inputs will not magically do this for you. You would have had to created a "form.php" (example filename) containing PHP functions, arrays, yadda yadda that will actually send the mail to you when the submit button is clicked. What you have is the frontend code and none of the backend code. Check out the following link to see what you need to do: PHP Form Mail Meta header and JavaScript injection protection Tags stripped and whitespace trimmed Validity and length checking on name and e-mail fields IP and browser details included in e-mail Valid data displayed when other errors occur Spam word check Common spam bot blocking New in v2: Bayesian style spam filtering A little code snippet: if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isBot()) exit("Bots not allowed.</p>"); function clean($data) { $data = trim(stripslashes(strip_tags($data))); return $data; } She also has a small tutorial if you'd like to read through what all of it means: http://www.tutorialtastic.co.uk/tutorial/php_mail_form_secure_and_protected Now, THIS really helps! Thank you very very much. Link to comment Share on other sites More sharing options...
Question
mrchetsteadman
Im tryin to get this contact form to send me an email but I can't figure this one out. Here is the code:
<div id="contact" class="rounded-10"> <form action="" method="post" id=""> <h3>Send us an Email</h3> <fieldset> <ol> <li> <label for="name" class="name">Your Name</label> <input type="text" name="name" id="name" value="" class="required" /> </li> <li> <label for="email" class="name">Your Email</label> <input type="text" name="email" id="email" value="" class="required email" /> </li> <li> <label for="message" class="name">Your Message</label> <textarea name="message" id="message" class="required" rows="" cols=""></textarea> </li> <li> <label for="submit" class="name"> </label> <input type="submit" id="submit" value="Submit" /> <input type="hidden" name="submitted" id="submitted" value="true" /> </li> </ol> </fieldset> </form> <div id="sent"> <h3>Your message has been sent!</h3> <p>We'll be in touch soon.</p> </div>I feel like it's one of those SIMPLE things that I am overlooking. Im not a coder at all so be easy on me. :D
Link to comment
Share on other sites
7 answers to this question
Recommended Posts