Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Contact form
#23
Your <title></title> tags are wrapped around your meta data. (Nothing to do with your issue though)

Give this code a shot instead.
I've modified everything for you so you can drop it right in. You just need to modify the TO field.
Code:
<?
// PUT THIS ABOVE THE FORM
// MODIFY THE DETAILS
if($_POST["submit"] == true) {
    $to = "your@emailaddress.com";
    $subject = "Contact From Website";
    $message = "Name: ".$_POST["name"];
    $message = $message."\n". "E-mail: ".$_POST["email"];
    $message = $message."\n". "Message: ".$_POST["message"];
    mail($to, $subject, $message);
    $successmsg = "<div id=\"successmsg\">Form Submitted Successfully</div>"; // Use CSS to style the id successmsg
} else {
    $successmgs = "";
}
?>

<?php // PUT THIS IN PLACE OF YOUR CURRENT FORM ?>

<?php echo $successmsg; ?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" class="contactform" >
    <p><label>Name:</label><br />
    <input type="text" class="text" name="name" /></p>
    <p><label>Email:</label><br />
    <input type="text" class="text" name="email" /></p>
    <p><label>Message:</label><br />
    <textarea class="text" name="message" ></textarea></p>
    <p><input type="submit" class="submit" value="Send Email" id="contact-submit" name="submit" /></p>
</form>

I haven't tested it, but it should work.
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply


Messages In This Thread
Contact form - by rhondab - 2009-08-23, 05:09:30
Contact form - by pixelita - 2009-08-23, 11:52:13
Contact form - by pixelita - 2009-08-23, 11:53:25
Contact form - by ccagle8 - 2009-08-23, 11:59:06
Contact form - by pixelita - 2009-08-23, 12:04:02
Contact form - by pixelita - 2009-08-23, 12:06:03
Contact form - by ccagle8 - 2009-08-23, 12:09:52
Contact form - by pixelita - 2009-08-23, 12:10:36
Contact form - by ccagle8 - 2009-08-23, 12:10:52
Contact form - by pixelita - 2009-08-23, 12:50:27
Contact form - by rhondab - 2009-08-23, 21:09:58
Contact form - by Sanddorn - 2009-09-24, 03:57:45
Contact form - by pixelita - 2009-09-24, 04:43:34
Contact form - by Sanddorn - 2009-09-25, 00:21:01
Contact form - by Faramir - 2009-10-02, 22:41:04
Contact form - by ccagle8 - 2009-10-03, 02:37:03
Contact form - by Faramir - 2009-10-03, 06:48:58
Contact form - by Nigel - 2009-12-15, 11:00:01
Contact form - by ccagle8 - 2010-01-02, 06:11:45
Contact form - by internet54 - 2010-01-03, 03:30:05
Contact form - by burdnick - 2010-01-06, 08:02:47
Contact form - by ccagle8 - 2010-01-06, 08:57:15
Contact form - by internet54 - 2010-01-06, 12:39:08



Users browsing this thread: 1 Guest(s)