Form submit help !

Discussion in 'PHP' started by muchochiz, Dec 24, 2010.

  1. #1
    Hi DPers , i am a newbie and i need some help . I am trying to set up a basic form with a text/ edit box , a drop down list and a submit button . I would like to know how i can configure the forum so that it submits to my mailbox . I would really appreciate your help
    P:S: I am a newbie so please explain in terms a "dummy" would understand lol.
     
    muchochiz, Dec 24, 2010 IP
  2. JREAM

    JREAM Member

    Messages:
    160
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    30
    #2
    Rather than type it all out watch this video Learn PHP (5) POST, GET, REQUEST - All you'd have to do is use a PHP mail() function after using POST from the form!
     
    JREAM, Dec 25, 2010 IP
  3. ProxyFreak

    ProxyFreak Peon

    Messages:
    57
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Simple, add your fields that you want information to in to the body of the code below. Add the code to your form submit; done.

    $to = "admin@mail.com";
    $subject = "Site Submission";
    $body = "$field1 \n $field2 \n $field3 \n $field4";
    mail($to, $subject, $body);
     
    ProxyFreak, Dec 25, 2010 IP
  4. tattooholic

    tattooholic Greenhorn

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    If you are using a platform (like wordpress) then there are many plugins that are very easy to configure
     
    tattooholic, Dec 26, 2010 IP
  5. floopy

    floopy Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    if you don't want to use php, you can do similar task with HTML: <a href="mailto:your-mail">mail me</a>
     
    floopy, Dec 28, 2010 IP
  6. dsdf

    dsdf Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    <?php
    if(isset($_POST['email'])) {
    $headers = 'From: ".$_POST['from']. "\r\n";
    mail($_POST['to'], $_POST['subject'], $_POST['message'], $headers);
    }
    ?>
    <form method="post" action ="">
    From : <input type="text" name="from">
    To : <input type="text" name="to">
    Subject : <input type="text" name="subject">
    Message : <input type="text" name="message">
    <input type="submit" />
    </form>
     
    dsdf, Dec 29, 2010 IP
  7. marshall26

    marshall26 Peon

    Messages:
    37
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7

    be careful with this that's a quick way to get backlisted as spam... people will abuse this and cause you a lot of grief
     
    marshall26, Dec 30, 2010 IP
  8. dsdf

    dsdf Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    It's only example, of course :). Because TS said he is begnner
     
    dsdf, Dec 30, 2010 IP