Results 1 to 3 of 3

Thread: HTML Feedback Form

  1. #1
    Join Date
    Aug 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HTML Feedback Form

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    This is an example of the mail function in PHP:

    contact.htm

    Code:
    <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>
    and then the PHP

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •