4 text field mailto form?

Discussion in 'PHP' started by Seqqa, Aug 2, 2011.

  1. #1
    I basically need a simple mailto script that'll send 4 text fields to an email address.

    I need like Name, Email, Username, Password and that's it with a Subject to be able to send to an email box. I need the submit button to be an image and also when clicked redirect to a second page.

    Does anybody have a PHP code to do this?

    + rep for anyone that can help!
     
    Seqqa, Aug 2, 2011 IP
  2. PHP Junior

    PHP Junior Peon

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Use the search function next time. Link.
     
    PHP Junior, Aug 2, 2011 IP
  3. UncleP

    UncleP Well-Known Member

    Messages:
    139
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Try this: http://phpfmg.sourceforge.net/

    Fill in the selected boxes, download, then ftp to your site. I use an iframe to load it. Job done. It has built in captcha so it keeps out the spam bots, you need something these days.
     
    UncleP, Aug 2, 2011 IP
  4. Seqqa

    Seqqa Well-Known Member

    Messages:
    3,695
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    115
    #4
    Am I right in thinking to excute PHP scripts within Exec-PHP? Will it work with the lastest version?

    Unrelated to PHP I know but, also to stop CSS interferance from the themes CSS do I suround the form code with the following below

    <!--start_raw-->

    [code_goes_here]

    <!--end_raw-->

    Thanks!
     
    Seqqa, Aug 3, 2011 IP
  5. freelanceinphp

    freelanceinphp Member

    Messages:
    134
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #5
    this is very simple, find a code below. <?php

    if($_POST['save']=='Send'){
    //mail function
    $to = 'id@example.com' . ', '; // note the comma


    // subject
    $subject = 'subject of mail';


    // message
    $message = '


    <p>You can add html mail here!</p>
    <table>
    <tr>
    <td>Name</td><td>'.$_POST['name'].'</td>
    </tr>
    <tr>
    <td>Email</td><td>'.$_POST['email'].'</td>
    </tr>
    <tr>
    <td>user</td><td>'.$_POST['username'].'</td>
    </tr>
    <tr>
    <td>pass</td><td>'.$_POST['password'].'</td>
    </tr>
    </table>
    ';


    // To send HTML mail, the Content-type header must be set
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";


    // Additional headers
    $headers .= 'To: ' . "\r\n";
    $headers .= 'From: ' . "\r\n";


    // Mail it
    mail($to, $subject, $message, $headers);



    }
    else{
    $done=0;
    }


    ?>
    <form action="contactus.php?bit=1" method="post">
    <table width="400">
    <tbody>
    <tr><td colspan="2">Contact us</td></tr>
    <?php if($done==1){echo "<h3><font color='#342D7e'>".$reply."<font></h3>";}?>
    <tr><td>Name</td><td><input type="text" name="name" value="<?php echo $_POST['name'] ?>"></td></tr>
    <tr><td>Email</td><td><input type="text" name="email" value="<?php echo $_POST['email'] ?>"></td></tr>
    <tr><td>Phone</td><td><input type="text" name="username" value="<?php echo $_POST['username'] ?>"></td></tr>
    <tr><td>Phone</td><td><input type="text" name="password" value="<?php echo $_POST['password'] ?>"></td></tr>
    <tr><td></td><td><input type="submit" name="save" value="Send"><input type="reset" name="clear" value="Clear"></td></tr>
    </tbody>
    </table>
    </form>
     
    freelanceinphp, Aug 3, 2011 IP