quarantine Posted May 27, 2009 Share Posted May 27, 2009 I have a pretty straight forward contact form that should email to the specified email address, but when I fill out the form, and submit, it just takes me to a blank page on contact.php instead of echoing that my message has been sent.... contact.html <html> <head> <title>Contact Form</title></head> <body> <form method="post" action="contact.php"> Name:<input name="fullname" type="text"> <br /><br /> Email:<input name="email" type="text"><br /> <br /> Message: <br /><textarea rows="5" cols="50" name=" message"> Please type your message here! </textarea> <br/> <br/> <input type="submit" value="Submit"> </form> </body> </html> contact.php <?php ini_set('display_errors','On'); // Grabing the info from the contact form $name = $_POST['fullname']; $from = $_POST['email']; $message = $_POST['message']; // Email info and variables $to = "[email protected]"; $subject = "Contact Form"; $body = "$message"; $headers = "From: $from" . "X-Mailer: php"; if (mail($to, $subject, $body, $headers)) { echo("<p>Message Sent!</p> <br /> <br /> Click <a href="#"> Here</a> to return to the main page."); } else { echo("<p>Message delivery failed... Please hit back, and try again.</p>"); } ?> Any suggestions? :'( -Thanks Link to comment https://forums.phpfreaks.com/topic/159923-solved-trouble-with-php-contact-form/ Share on other sites More sharing options...
jsschmitt Posted May 27, 2009 Share Posted May 27, 2009 Easy to fix: change: echo("<p>Message Sent!</p> <br /> <br /> Click <a href="#"> Here</a> to return to the main page."); to: echo("<p>Message Sent!</p> <br /> <br /> Click <a href='#'> Here</a> to return to the main page."); Link to comment https://forums.phpfreaks.com/topic/159923-solved-trouble-with-php-contact-form/#findComment-843487 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.