Jump to content

PHP Email Form


Hunter94

Recommended Posts

Ok well here is the PHP Email Form I'm using.

 

HTML Code:

<form method="post" action="sendmail.php">
  Email: <input name="email" type="text" /><br />
  Message:<br />
  <textarea name="message" rows="15" cols="40">
  </textarea><br />
  <input type="submit" />
</form>

 

PHP Code:

<?php
  $email = $_REQUEST['email'] ;
  $message = $_REQUEST['message'] ;

  mail( "yourname@example.com", "Feedback Form Results",
    $message, "From: $email" );
  header( "Location: http://www.example.com/thankyou.html" );
?>

 

When I change every thing to my Info it doesn't send anything to my email and when I click Submit Query it just redirects me to the PHP Code.

 

NOTE: I haven't put it on the internet so I'm not sure if that's the problem or not.

 

 

Thank You

 

Hunter Davis.

Link to comment
https://forums.phpfreaks.com/topic/144999-php-email-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.