HTML code for Name, Email, Cell# & send button? please help me! thx

Discussion in 'HTML & Website Design' started by adrien, Jul 29, 2011.

  1. #1
    Hello All..!

    It would be awesome if I could get a little help here...!

    I'm trying to create a contact form with HTML code that has Name, Email and Cell#.

    The issue that I'm running into is the "Send" button. I would like the code to allow the "Send" button to be able to send there information to me...as well as take them to the "next page" in my website. So once they click the send button it will serve two purposes...to email me there info. and to send them to the next page that want them to go to.

    Any help with the actual coding would be very much appreciated..!:)

    Thank you in advance,
    Adrien
     
    adrien, Jul 29, 2011 IP
  2. dthoai

    dthoai Member

    Messages:
    106
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    38
    #2
    You can use following codes:

    
    <?php
    $myemail = "[COLOR="red"]your email[/COLOR]";
    $nextpage = "[COLOR="red"]nextpage.php[/COLOR]";
    
    if (isset($_POST['Submit'])) {
      $message = "Name: $_POST[Name]\r\nEmail: $_POST[Email]\r\nCell: $_POST[Cell]\r\nComment: $_POST[Comment]";
      @mail($myemail, "New contact added", $message);
      header("Location: $nextpage");
    } else {
    ?>
    <html>
    <body>
    <form method="post" action="contact.php">
      <table>
        <tr>
          <td>Name</td>
          <td><input type="text" name="Name" /></td>
        </tr>
        <tr>
          <td>Email</td>
          <td><input type="text" name="Email" /></td>
        </tr>
        <tr>
          <td>Cell#</td>
          <td><input type="text" name="Cell" /></td>
        </tr>
        <tr>
          <td>Comment</td>
          <td><textarea name="Comment" cols="50" rows="20"></textarea></td>
        </tr>
        <tr>
          <td></td>
          <td><input type="submit" name="Submit" value="Send" /></td>
        </tr>
      </table>
    </form>
    </body>
    </html>
    <?php
    }
    ?>
    
    Code (markup):
     
    dthoai, Jul 29, 2011 IP
  3. sudhisinha

    sudhisinha Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    <form method="post" action="contact.php">
    <table>
    <tr>
    <td>Name</td>
    <td><input type="text" name="Name" /></td>
    </tr>
    <tr>
    <td>Email</td>
    <td><input type="text" name="Email" /></td>
    </tr>
    <tr>
    <td>Cell#</td>
    <td><input type="text" name="Cell" /></td>
    </tr>
    <tr>
    <td>Comment</td>
    <td><textarea name="Comment" cols="50" rows="20"></textarea></td>
    </tr>
    <tr>
    <td></td>
    <td><input type="submit" name="Submit" value="Send" /></td>
    </tr>
    </table>
    </form>
    </body>
    </html>
     
    sudhisinha, Aug 27, 2011 IP
  4. creativewebmaster

    creativewebmaster Active Member

    Messages:
    654
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    78
    #4
    I think you needs here PHP programming for the form.
     
    creativewebmaster, Aug 27, 2011 IP