html email forwarding

Discussion in 'Web Programming' started by Darkgroove, Nov 18, 2007.

html email forwarding
  1. Unread #1 - Nov 18, 2007 at 3:37 AM
  2. Darkgroove
    Referrals:
    0

    Darkgroove Guest

    html email forwarding

    i'm making user services site where uses can come and fill out an order form of the services they want and the information i can use to contact them, such as their email, what they need trained, if they need a MM etc.

    once the user fills out the order form, the page just refreshes. how can i make the information entered by the user, get sent to an email, so I actually know what they need?
     
  3. Unread #2 - Nov 18, 2007 at 9:39 AM
  4. pur3min
    Joined:
    Oct 15, 2007
    Posts:
    189
    Referrals:
    0
    Sythe Gold:
    0

    pur3min Active Member

    html email forwarding

    Code:
    <?php
    if(isset($_POST['buttonname'])) {
    $name=htmlspecialchars($_POST['name']) ;
    $email=htmlspecialchars($_POST['email']) ;
    $message=htmlspecialchars($_POST['message']) ;
    $subject=htmlspecialchars($_POST['subject']) ;
    $youremail="[email protected]" ;
    if(empty($_POST['name']) || empty($_POST['email]) || empty($_POST['message']) || empty($_POST['subject'])) {
    echo "You did not fill in some of the required values! Please go back and try again!" ;
    }else{
    mail(youremail,"Contact form","Message: $message  Email: $email","From: $name") or die('Could not send email, this will be fixed soon!') ;
    header('thankyou.html') ;
    exit() ;
    }
    }
    ?>
    <form action="<?= $_SERVER['PHP_SELF'] ;?>" method="post" >
    <input type="text" name="name" />
    <input type="text" name="email" />
    <input type="text" name="message" />
    <input type="subject" name="subject" />
    <input type="submit" name="buttonname" />
    </form>
    Just a basic one (Might be buggy, sorry I don't have much time now but the basics are in there!). Edit the required php data to suit your needs and save it as a php file (Such as mail.php).

    For some rsgp, I could code you a custom (better) one for your needs.
     
  5. Unread #3 - Nov 18, 2007 at 10:06 AM
  6. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    html email forwarding

    Just a note, you need PHP installed (obviously) and a working mail server. If you're using a free host, there is a great chance that there won't be a mail server available for you to use.
     
  7. Unread #4 - Nov 20, 2007 at 4:52 AM
  8. Darkgroove
    Referrals:
    0

    Darkgroove Guest

    html email forwarding

    Thanks guys, i'll get back to you on your offer pur3. Add my msn or something, and i'll let you know.
     
< [PERL] Basic Port Scanner. | (new rs client) No download! need feedback >

Users viewing this thread
1 guest


 
 
Adblock breaks this site