E-mail Form...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    E-mail Form...

    Ok had a few inboxes asking about a E-Mail Form...

    Create contact.php
    insert this
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Contact WhiteWarrior</title>
    <style type="text/css">
    .box { margin-top: 0px; margin-bottom: 0px; margin-left: 100px; width: 500px; padding: 5px; background-color: silver; color: blue; }
    
    form { border: 6px solid lightgrey; padding: 5px; background-color: silver; }
    
    input { background-color: lightgrey; color: blue; }
    
    select { background-color: darkgray; color: blue; }
    
    input.radio { background-color: blue; }
    
    textarea { background-color: lightgrey; color: blue; }
    
    .button { font-size: 16px; font-family: Lucida Calligraphy; background-color: darkgray; color: blue; }
    
    </style>
    </head>
    <body>
    
    <form method="post" action="sendmail.php">
    
    <?php
    $ipi = getenv("REMOTE_ADDR");
    $httprefi = getenv ("HTTP_REFERER");
    $httpagenti = getenv ("HTTP_USER_AGENT");
    ?>
    
    <input type="hidden" name="ip" value="<?php echo $ipi ?>" />
    <input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
    <input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
    
    
    Your Name: 
    
    <input type="text" name="visitor" size="35" />
    
    
    Your Email:
    
    <input type="text" name="visitormail" size="35" />
    
    
    Whats It About?:
    
    <select name="attn" size="1">
    <option value=" General Question ">General Question</option>
    <option value=" Need Help ">Need Help</option>
    </select>
    
    
    
    Mail Message:
    
    
    <textarea name="notes" rows="4" cols="40"></textarea>
    
    
    <input type="submit" value="Send Mail" />
    </form>
    
    </body>
    </html>
    Then make a file called sendmail.php and insert
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sent</title>
    <style type="text/css">
    .box { margin-top: 0px; margin-bottom: 0px; margin-left: 100px; width: 500px; padding: 5px; background-color: silver; color: blue; }
    
    form { border: 6px solid lightgrey; padding: 5px; background-color: silver; }
    
    input { background-color: lightgrey; color: blue; }
    
    select { background-color: darkgray; color: blue; }
    
    input.radio { background-color: blue; }
    
    textarea { background-color: lightgrey; color: blue; }
    
    .button { font-size: 16px; font-family: Lucida Calligraphy; background-color: darkgray; color: blue; }
    
    </style>
    </head>
    <body>
    
    <?php
    
    $ip = $_POST[&#39;ip&#39;];
    $httpref = $_POST[&#39;httpref&#39;];
    $httpagent = $_POST[&#39;httpagent&#39;];
    $visitor = $_POST[&#39;visitor&#39;];
    $visitormail = $_POST[&#39;visitormail&#39;];
    $notes = $_POST[&#39;notes&#39;];
    $attn = $_POST[&#39;attn&#39;];
    
    
    if (eregi(&#39;http:&#39;, $notes)) {
    die ("Do NOT try that! ! ");
    }
    if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
    {
    echo "<h2>Use Back - Enter valid e-mail</h2>\n";
    $badinput = "<h2>Feedback was NOT submitted</h2>\n";
    echo $badinput;
    die ("Go back! ! ");
    }
    
    if(empty($visitor) || empty($visitormail) || empty($notes )) {
    echo "<h2>Use Back - fill in all fields</h2>\n";
    die ("Use back! ! ");
    }
    
    $todayis = date("l, F j, Y, g:i a");
    
    $attn = $attn;
    $subject = $attn;
    
    $notes = stripcslashes($notes);
    
    $message = " $todayis [EST] \n
    About: $attn \n\n
    Message: $notes \n\n
    From: $visitor ($visitormail)\n
    Additional Info : IP = $ip \n
    Browser Info: $httpagent \n
    Referral : $httpref \n
    ";
    
    $from = "From: $visitormail\r\n";
    
    
    mail("YOUR EMAIL HERE", $subject, $message, $from);
    
    ?>
    
    <p align="center">
    Date: <?php echo $todayis ?>
    
    
    Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
    
    
    
    About: <?php echo $attn ?>
    
    
    Message:
    
    <?php $notesout = str_replace("\r", "
    ", $notes);
    echo $notesout; ?>
    
    
    <?php echo $ip ?>
    
    
    [url="index.php"]Back[/url]
    </p>
    
    </body>
    </html>
    Upload It Then Its Done... Remember To Change the e-mail to your email address.

    #2
    Parse error: parse error, unexpected &#39;;&#39; in /home/www/xxxxxxxxxx/web/sendmail.php on line 74

    Comment


      #3
      on the sendmail.php edit the line
      Code:
      mail("YOUR EMAIL HERE", $subject, $message, $from);
      To just your email address... remove the colour parts because the bbcode must have been changed on this site

      Comment


        #4
        these codes are all copy paste from http://www.ibdhost.com/contact/ not ur own codes except for the styles
        Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

        <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

        Comment


          #5
          these codes are all copy paste from http://www.ibdhost.com/contact/ not ur own codes except for the styles [/b]
          so what if its copy/paste ???

          he didnt said its his script...
          and unlike you he share things at least
          It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
          ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
          ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
          キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

          Comment


            #6
            where must i put my email?i hv try but the email was not send to my email..

            Comment


              #7
              these codes are all copy paste from http://www.ibdhost.com/contact/ not ur own codes except for the styles [/b]
              Didn&#39;t say it was my coding.. if you was to read the thread before making a comment you would know

              alexism put your email here and ill do it for ya

              Comment


                #8
                this is my email alexis.m_3487@yahoo.com

                Comment


                  #9
                  when have i never shared? and hey i was only saying that the code were from there i meant no offence to whitewarrior
                  Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

                  <span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">BEST MOBILE ADVERTISER</span></span>

                  Comment


                    #10
                    Ok your sendmail.php will be this....
                    Code:
                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                    
                    <html>
                    <head>
                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                    <title>Sent</title>
                    <style type="text/css">
                    .box { margin-top: 0px; margin-bottom: 0px; margin-left: 100px; width: 500px; padding: 5px; background-color: silver; color: blue; }
                    
                    form { border: 6px solid lightgrey; padding: 5px; background-color: silver; }
                    
                    input { background-color: lightgrey; color: blue; }
                    
                    select { background-color: darkgray; color: blue; }
                    
                    input.radio { background-color: blue; }
                    
                    textarea { background-color: lightgrey; color: blue; }
                    
                    .button { font-size: 16px; font-family: Lucida Calligraphy; background-color: darkgray; color: blue; }
                    
                    </style>
                    </head>
                    <body>
                    
                    <?php
                    
                    $ip = $_POST[&#39;ip&#39;];
                    $httpref = $_POST[&#39;httpref&#39;];
                    $httpagent = $_POST[&#39;httpagent&#39;];
                    $visitor = $_POST[&#39;visitor&#39;];
                    $visitormail = $_POST[&#39;visitormail&#39;];
                    $notes = $_POST[&#39;notes&#39;];
                    $attn = $_POST[&#39;attn&#39;];
                    
                    
                    if (eregi(&#39;http:&#39;, $notes)) {
                    die ("Do NOT try that! ! ");
                    }
                    if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
                    {
                    echo "<h2>Use Back - Enter valid e-mail</h2>\n";
                    $badinput = "<h2>Feedback was NOT submitted</h2>\n";
                    echo $badinput;
                    die ("Go back! ! ");
                    }
                    
                    if(empty($visitor) || empty($visitormail) || empty($notes )) {
                    echo "<h2>Use Back - fill in all fields</h2>\n";
                    die ("Use back! ! ");
                    }
                    
                    $todayis = date("l, F j, Y, g:i a");
                    
                    $attn = $attn;
                    $subject = $attn;
                    
                    $notes = stripcslashes($notes);
                    
                    $message = " $todayis [EST] \n
                    About: $attn \n\n
                    Message: $notes \n\n
                    From: $visitor ($visitormail)\n
                    Additional Info : IP = $ip \n
                    Browser Info: $httpagent \n
                    Referral : $httpref \n
                    ";
                    
                    $from = "From: $visitormail\r\n";
                    
                    
                    mail("alexis.m_3487@yahoo.com", $subject, $message, $from);
                    
                    ?>
                    
                    <p align="center">
                    Date: <?php echo $todayis ?>
                    
                    
                    Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
                    
                    
                    
                    About: <?php echo $attn ?>
                    
                    
                    Message:
                    
                    <?php $notesout = str_replace("\r", "
                    ", $notes);
                    echo $notesout; ?>
                    
                    
                    <?php echo $ip ?>
                    
                    
                    [url="index.php"]Back[/url]
                    </p>
                    
                    </body>
                    </html>

                    Comment


                      #11
                      thanks it works




                      Comment


                        #12
                        thanks a lot white warruor..can u give me the wml version?

                        Comment


                          #13
                          somebody?

                          Comment

                          Working...
                          X