How do I make a Contact Form?

Discussion in 'HTML & Website Design' started by Davey Crocket, May 4, 2006.

  1. #1
    How do I make a contact form, so a user can enter in some information on a website and then that will get emailed to me? Can somebody point me in the right direction? Maybe someone would like to build one for me...I can pay $:rolleyes:


    Thanks
    -Dave
     
    Davey Crocket, May 4, 2006 IP
  2. jrd1mra

    jrd1mra Peon

    Messages:
    243
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #2
    there are some very simple html and php forms. Is your site PHP?
    try this for PHP. if you can upload it to a php enabled server you can call it from any website, as long as you allow it in the code. Its pretty simple.
    http://www.dtheatre.com/scripts/

    or if you just want a simple mailer, just look up "how to make an e-mail form" in Google, you will find tons of info on making easy forms.
     
    jrd1mra, May 4, 2006 IP
  3. QiSoftware

    QiSoftware Well-Known Member

    Messages:
    805
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    158
    #3
    QiSoftware, May 4, 2006 IP
  4. Interact

    Interact Active Member

    Messages:
    175
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    53
    #4
    yeah.... there are lot of free made script for contact.
    keyword: "tutorials contact form"

    ;)
     
    Interact, May 5, 2006 IP
  5. seolion

    seolion Active Member

    Messages:
    1,495
    Likes Received:
    97
    Best Answers:
    0
    Trophy Points:
    90
    #5
    I would be interested. pm me more on it.
     
    seolion, May 5, 2006 IP
  6. Shost

    Shost Peon

    Messages:
    5
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    here is a lite example you look and understand
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>SmE Form</title>
    <style type="text/css">
    #form{
    font: 76% Arial, sans-serif;
    width:510px;
    background-color: #BBD8FF;
    padding:10px;
    }
    label{
    float:left;
    display:inline;
    width:150px;
    line-height:16px;
    margin: 3px 10px;
    text-align:center;
    background: #FFF;
    }
    INPUT,textarea{
    margin:2px 0 2px;
    border:solid #000000 1px;
    width:auto;
    height: auto
    }
    br{
    clear:left
    }input#go{
    margin: 10px 0 0 130px;
    border:solid #333 1px;
    background: #CCC;
    width:auto;
    height: auto
    }
    </style>
    </head>
    <body>
    <?php
    session_start();
    // language files
    $_C1="code is wrong";
    $_C2="requeride file";
    $_C3="submit this";
    $_C4="invalid email";
    error_reporting(0);
    if(isset($_POST['smeform']))
    {
    // i add this to aditional protection spamers have a lot of time free to make a bad actions if i make a mistake in for this protect you agains email injections!
    function smeprotect($a)
    {
        $bad_str = array("content-type:","charset=","mime-version:","multipart/mixed","bcc:","../");
        $suspect_found = false;
        foreach($bad_str as $suspect)
          {
        if(eregi($suspect, strtolower($a)))
    	  {
    	$suspect_found = true;
       $a = eregi_replace($suspect, " (>>><strong>".$suspect."</strong><<<) ", $a);
    die("Script processing cancelled: string ".$a." contains text portions that are potentially dangerous to this server. Please use your browser's back-button to return to the previous page .");
          }
          }
    
    }
    foreach ($_POST as $value)
    {
        smeprotect($value);
    }
    if(empty($_POST['Name'])) {	$_rerror.="Name $_C2<br>"; }if (!ereg("(^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,4})$)", $_POST['Email'], $adress )){$_rerror.="$_C4<br/>";}if(empty($_POST['Email'])) {	$_rerror.="Email $_C2<br>"; }if(empty($_POST['Subject'])) {	$_rerror.="Subject $_C2<br>"; }if(empty($_POST['Message'])) {	$_rerror.="Message $_C2<br>"; }
    if(!isset($_SESSION['verification']) || trim($_POST['code']) != $_SESSION['verification'])
    {
    $_rerror.= $_C1;
    }
    if(empty($_rerror))
    {
    $date = date("m/d/Y H:i:s");
    $ip = $_SERVER['REMOTE_ADDR'];
    // SEND EMAIL FROM YOUR EMAIL 
    @mail("email@email.com","test form","".$date." ip :".$ip."\n--------------------------------------------------------\nName : ".$_POST['Name']."\nEmail : ".$_POST['Email']."\nSubject : ".$_POST['Subject']."\nMessage : ".$_POST['Message']."\n\n--------------------------------------------------------\n\n","From:".$_POST['Email']."\nMime-Version: 1.0\nContent-Type: text/plain;charset=UTF-8\nContent-Transfer-Encoding: 7bit");
    echo "<div id=form>wwwww</div>";
    $_ALLAREOK="1";
    unset($_SESSION['verification']);
    }
    }
    $letters =
    array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9');
    srand((double) microtime() * 1000000);
    for ($c = 0; $c <= "4"; $c++)
    $randomkey .= $letters[rand(0,count($letters))];
    if(!isset($_SESSION['verification']))
     {
    	$_SESSION['verification']=$randomkey;
    }
    if(empty($_ALLAREOK))
    {
    ?>
    <form action="" id="form" method="post" name="smeform">
    <p align="center"><?=$_rerror;?></p>
    <label for="Name">Name</label><input type="text" name="Name" maxlength="255"  value="<?=$_POST['Name']?>"><br /><label for="Email">Email</label><input type="text" name="Email" maxlength="255"  value="<?=$_POST['Email']?>"><br /><label for="Subject">Subject</label><input type="text" name="Subject" maxlength="255"  value="<?=$_POST['Subject']?>"><br /><label for="Message">Message</label><textarea name="Message" ></textarea><br /><label for="code">Code</label>
    <input name="code" type="text" maxlength="10" size="10"> <strong><?=$_SESSION['verification'];?></strong><br /><input name="smeform" id="go" value="<?=$_C3;?>"  type="submit" /></form>
    <?php
    }
    ?>
    </body>
    </html>
    HTML:
     
    Shost, May 6, 2006 IP
    AdamSee likes this.
  7. wwws

    wwws Notable Member

    Messages:
    3,385
    Likes Received:
    285
    Best Answers:
    0
    Trophy Points:
    225
    #7
    wwws, May 6, 2006 IP
  8. rickvidallon

    rickvidallon Peon

    Messages:
    147
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #8
    If you are a windows guy ( I can here the moans now) check out aspin.com.
    Other wise check your hosting account. Most web host accounts have a plug and play form maker.
     
    rickvidallon, May 6, 2006 IP
  9. skipper55

    skipper55 Active Member

    Messages:
    136
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #9
    skipper55, May 7, 2006 IP
  10. Link.ezer.com

    Link.ezer.com Peon

    Messages:
    647
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #10
    try this web meta builder tool
    hope you will like it

    it is easy to use.... it save me a lots time

    it creates codes for you intstantly
    you may edit before you cut the code

    I do use it very often
     
    Link.ezer.com, Jun 16, 2006 IP
  11. xeno

    xeno Peon

    Messages:
    788
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #11
    xeno, Jun 17, 2006 IP
  12. TechnoGeek

    TechnoGeek Peon

    Messages:
    258
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #12
    If you are intending to put a contact form on your website, chances are you will need to know something about CGI programming. CGI is the protocol that specifies how the information input by a user at a Web page is handled to the server program that will process that information. Even to install a ready made script you will need some knowledge of CGI. If you are new to CGI, this introduction can help you:

    CGI programming
     
    TechnoGeek, Jun 19, 2006 IP
  13. moneyspeaks

    moneyspeaks Peon

    Messages:
    450
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #13
    just use the webs leader, aweber.com automatic opt-in opt-outs, bulk emailing and tracking. I think its $20 a month, but def worth it.
     
    moneyspeaks, Jun 19, 2006 IP
  14. DarkCircuit

    DarkCircuit Banned

    Messages:
    243
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I believe DynaForm is the best Contact Form.
     
    DarkCircuit, Jun 20, 2006 IP