IS it possible to create an HTML page that users can fill out and the page will email you the user's input? are there any JavaScripts?
ton
IS it possible to create an HTML page that users can fill out and the page will email you the user's input? are there any JavaScripts?
ton
You could work something out using HTML and javascript but, it would not be all that reliable due to the inevitable dependence on how email is configured (sometimes not at all, sometimes in a way incompatible with any sort of set up like this that uses HTML and javascript) by each user. The best approach is to use a server side mail form. Your host may have something available for you to use, ask them first. There are also quite a number of third party mail forms available on the web. Some are free, some are not.
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
This is an example of the mail function in PHP:
contact.htm
and then the PHPCode:<form id="emailform" method="post" action="post.php"> Your E-mail: <br><input name="email" id="email"> <br>Subject: <br><input name="subject" id="subject"> <br>Message: <br><textarea cols="40" rows="10" name="message" id="message"></textarea> <br><input type="submit" value="Submit" id="button" onclick="check()"> </form>
post.php
Code:<?php $to = "mburt_2005@hotmail.com"; $subject = $_POST["subject"]; $body = "From: $_POST[email]\n$_POST[message]"; $headers = "From: $_POST[email]" . "\r\n" . "Reply-To: $_POST[email]" . "\r\n" . "X-Mailer: PHP/" . phpversion(); if (mail($to,$subject,$body,$headers)) { echo "The e-mail was successfully sent."; } else {echo "E-mail was not sent. Please check all of the information you entered."} echo "<br><input type='button' value='Back' onclick='window.history.back()'>" ?>
I use this method on my website:
http://mburt.mb.funpic.org/contact.php
- Mike
Bookmarks