Hi all,
I'm trying to create a simple form for users to enter their email address and send an email to my site.
I have found a simple form and php script that coincides...
Located below HTML:
<form method="post" action="contact.php" align="center">
My Email Address: <br><input name="email" type="text" size="60"><br><br>
Message:<br>
<textarea name="message" rows="15" cols="60"></textarea><br>
<input type="submit">
</form>
PHP:
<?php
$to = "you@yoursite.com";
$subject = "Contact Us";
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;
$headers = "From: $email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>
I did a project a few years ago using AJAX where I returned a message back to a div, is there a simple way to do this for this form? I just want it to be as simple as possible....
Thanks.