generic Posted January 8, 2008 Share Posted January 8, 2008 Hi, I'm a graphic designer with very limited programming experience and this is just not working for me. When I try to submit the form using the following code, the form does nothing. It doesn't even submit at all. Anyone spot anything that might be causing this (aside from the general sloppiness of the code itself)? Thanks in advance! Gen <?php if (isset($_POST['submit'])){ $to = "me@mysite.com"; $subject = "website contact"; $name = $_POST['name']; $phone = $_POST['phone']; $email = $_POST['email']; $query = $_POST['query']; $strbody="Name:".$name."\r\n Phone :".$phone."\r\n Email :".$email."\r\n Query :".$query."\r\n"; mail($to, $subject, $strbody); echo "<p>Success!</p>"; } else { echo "<form id=\"contact\" name=\"contact_form\" method=\"post\" action=\"".$_SERVER['PHP_SELF']."\"> <p class=\"contact_label\">Your Name:<br /> <input name=\"name\" type=\"text\" /><br /> Your Email:<br /> <input name=\"email\" type=\"text\" /><br /> Your Phone Number:<br /> <input name=\"phone\" type=\"text\" /><br /> Question/Comment:<br /> <textarea name=\"query\" cols=\"\" rows=\"4\"></textarea> </p> <p> <input name=\"submit\" id=\"submit\" type=\"button\" value=\"Send It\" style=\"width: auto;\" /> </p> </form>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/85049-solved-cant-seem-to-get-mail-form-working/ Share on other sites More sharing options...
Ken2k7 Posted January 8, 2008 Share Posted January 8, 2008 Find: <input name=\"submit\" id=\"submit\" type=\"button\" value=\"Send It\" style=\"width: auto;\" /> Replace <input name=\"submit\" id=\"submit\" type=\"submit\" value=\"Send It\" style=\"width: auto;\" /> Quote Link to comment https://forums.phpfreaks.com/topic/85049-solved-cant-seem-to-get-mail-form-working/#findComment-433745 Share on other sites More sharing options...
generic Posted January 8, 2008 Author Share Posted January 8, 2008 Wow. How dumb was that. It's always the little things. Thanks for the amazingly quick reply. Cheers, Gen Quote Link to comment https://forums.phpfreaks.com/topic/85049-solved-cant-seem-to-get-mail-form-working/#findComment-433748 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.