Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2005
    Location
    Manchester, UK
    Posts
    731
    Tokens
    0
    Habbo
    pappalou

    Default need someone to make me a php form

    one that submits to an e-mail of my choice

    needs 2 single line boxes, then a drop down box, then 2 bigger boxes.

    i can do the rest i just need the basic code for the form & the php for the form submission.

    thanks

  2. #2
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    Haven't tested it.
    PHP Code:
    <?php
    if(isset($_POST["textbox"]) && isset($_POST["textbox2"]) && isset($_POST["dropdown"]) && isset($_POST["textarea"]) && isset($_POST["textarea2"]))
    {
        
    $textbox $_POST["textbox"];
        
    $textbox2 $_POST["textbox2"];
        
    $dropdown $_POST["dropdown"];
        
    $textarea $_POST["textarea"];
        
    $textarea2 $_POST["textarea2"];
        
        if(
    $textbox == "" || $textbox2 == "" || $textarea == "" || $textarea2 == "")
        {
            
    header('Location: page.php?message=blank');
        }
        else
        {
            
    $to      '[email protected]';
            
    $subject 'the subject';
            
    $message 'hello';
            
    $headers 'From: [email protected]"\r\n" .
                       
    'Reply-To: [email protected]"\r\n" .
            
    mail($to$subject$message$headers);
            
    header('Location: page.php?message=success');
        }

    }

    if(
    $_GET["message"] == "blank")
    {
        echo(
    "<span style="color:red;">You left a required field blank.</span><br><br>\n");
    }
    elseif(
    $_GET["message"] == "success")
    {
        echo(
    "<span style="color:green;">Your details have successfully been sent.</span><br><br>\n");
    }
    ?>
    <form method="post">
        <p>Text Box 1:<br>
        <input type="text" name="textbox" size="20" value="<? echo $textbox?>"><br>
        <br>
        Text Box 2:<br>
        <input type="text" name="textbox2" size="20" value="<? echo $textbox2?>"><br>
        <br>
        Drop Down 1:<br>
        <select size="1" name="dropdown"></select><br>
        <br>
        Text Area 1:<br>
        <textarea rows="2" name="textarea" cols="20" value="<? echo $textarea?>"></textarea><br>
        <br>
        Text Area 2:<br>
        <textarea rows="2" name="textarea2" cols="20" value="<? echo $textarea2?>"></textarea><br>
        <br>
        <input type="submit" value="Submit" name="submit"></p>
    </form>

Posting Permissions

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