Jump to content

defektdesigns

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

defektdesigns's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. what I mean by it works is that it will send me an email but the email will not show me the email they have entered.
  2. I'll try my best to explain it. It will work if i simply change <input type="text" name="subject" class="field"/> to <input type="text" name="email" class="field"/> but for some reason if I make it <input type="text" name="subject" class="field"/> it will not work. Yes the php and the html form are in the same file called contact.php
  3. Hi I am brand new to PHP Freaks and really hope someone can help me out with my php problem. I have a contact form that I am using and all the php and form info is in one file. The contact form worked before but it wasn't correct because one of the names was wrong on the form. Here is the php I have put just below the opening body tag: <?php $name = $_POST["name"]; $email = $_POST["email"]; $subject = $_POST["subject"]; $comment = $_POST["comment"]; $submit = $_POST["submit"]; if(isset($submit)){ $sendTo = "myemail@mydomain.com"; $message = "<h3>To You:</h3> $comment<br /> <br /> From: $name ($email)"; $headers = "From: $name <$email> \r\n"; $headers .= "X-Mailer:PHP/\r\n"; $headers .= "MIME-Version:1.0\r\n"; $headers .= "Content-type:text/html; charset=iso-8859-1\r\n"; $sent = mail($sendTo, $subject, $message, $headers); } ?> and here is the form: <form action="" method="post"> <table> <tr> <td>Name: </td> <td><input type="text" name="name" class="field"/></td> </tr> <tr> <td>Email: </td> <td><input type="text" name="email" class="field" /></td> </tr> <tr> <td>Subject: </td> <td><input type="text" name="subject" class="field"/></td> </tr> <tr> <td>Comment: </td> <td><textarea name="comment" cols="30" rows="8" > </textarea></td> </tr> <tr> <td><input type="submit" name="submit" value="Send" /></td> </tr> </table> </form> <?php if ($sent){ echo "Thank you for your message!"; } ?> now when I had it working I had accidentally had the subject name set to "email" but when I simply change it to "subject" as it should be it won't work anymore. I would love to just let it work the wrong way but this won't work because when I receive the email it displays the subject instead of the persons email and I need to see the email to get back to them. I really hope someone can help me with this! Thanks, Curtis
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.