dubfoundry Posted July 17, 2009 Share Posted July 17, 2009 I have this seeamingly simple code that does not execute at all for some reason...i cant figure it out. im using godaddy for hosting and im trying to send a mail via a form...Godady says it doesnt block these type of scripts and it should work...go figure.. Is there a problem with my script preventing it from working? <?php echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"\"> <p>Full Name:<br/> <label> <input type=\"text\" name=\"name\" id=\"name\" /> <br /> </label> Email:<br/> <label> <input type=\"text\" name=\"email\" id=\"email\" /> <br /> </label> Phone:<br/> <label> <input type=\"text\" name=\"phone\" id=\"phone\" /> </label> <p>Message:<br/> <label> <textarea name=\"message\" cols=\"23\" rows=\"10\" id=\"message\"></textarea> </label> </p> <p> <label> <input type=\"Submit\" name=\"Submit\" id=\"Submit\" value=\"Submit\" /> </label> </p> </form>"; if(isset($_GET['Submit'])){ $subject = "Consultation Request"; $myEmail ="[email protected]"; $message = $_GET['message']; $phone = $_GET['phone']; $Name = $_GET['name']; $email = $_GET['email']; $mail_body = "From: ". $Name . " <" . $email . ">\r\n". $message." "; echo "Thank you"; mail($myEmail, $subject, $mail_body); }else{ echo "Please Fill the form out"; } ?> Link to comment https://forums.phpfreaks.com/topic/166279-problems-with-php-mail/ Share on other sites More sharing options...
MatthewJ Posted July 17, 2009 Share Posted July 17, 2009 You need to change the form method from post to get... or change all of your vars to use $_POST Link to comment https://forums.phpfreaks.com/topic/166279-problems-with-php-mail/#findComment-876893 Share on other sites More sharing options...
dubfoundry Posted July 17, 2009 Author Share Posted July 17, 2009 Thank you i didn't even realize that.... Link to comment https://forums.phpfreaks.com/topic/166279-problems-with-php-mail/#findComment-877190 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.