Contact us page
Hello, I have a question. My question is: how do I make a form that when the viewer clicks "send", it puts it in an email which is then sent to me. I need this for my "contact us" page.
The form would have to send the info via action attribute to a page which has a scripting language.
PHP is a good example.
Page 1: The HTML Page
Page 2: The PHP Page
<form action="process.php" method="post">
<input type="submit" name="send_email" />
//Who is this email going to be sent to?
$to = 'email@example.com';
//What is the email's subject
$subject = 'Thank You For Contacting Us';
//What is the email's message
$message = 'This email is to inform you that we...';
if(isset($_POST['send_email'])) //User submitted form
echo '<p>We have received your message. Thank you for contacting us!</p>';
echo '<p>There was a problem contacting us...try again later.</p>';
else //The user is visiting the page but the form wasn't submitted
echo '<p>Please submit the form before viewing this page.</p>';
This is just a basic script, it will send an email after the form is submitted and thats all.
You can google the phrase "PHP Contact Page Tutorial" to get much better examples.
Thanks a ton
thanks SO much, this helped a lot. I now can have a decent "contact us" page.
No problem. Glad I could help.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread