Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2006
    Location
    i live on my private island!
    Posts
    366
    Tokens
    0

    Default Need Contact Us Form

    Hi, does any one have or know where i can get a working contact us form?
    +rep if you do
    (\_/)
    (o.o) This is Bunny. Copy Bunny to
    ('')('') help him achieve world domination.

  2. #2
    Join Date
    Oct 2006
    Posts
    1,026
    Tokens
    0

    Latest Awards:

    Default

    Name contact.php

    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>Email Form </title>
    </head>
    <body>
    <form method="post" action="sendeail.php">
    <!-- DO NOT change ANY of the php sections -->
    <?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: <br />
    <input type="text" name="visitor" size="35" />
    <br />
    Your Email:<br />
    <input type="text" name="visitormail" size="35" />
    <br /> <br />
    <br />
    Attention:<br />
    <select name="attn" size="1">
    <option value=" Sales n Billing ">Sales n Billing </option> 
    <option value=" General Support ">General Support </option> 
    <option value=" Technical Support ">Technical Support </option> 
    <option value=" Webmaster ">Webmaster </option> 
    </select>
    <br /><br />
    Mail Message:
    <br />
    <textarea name="notes" rows="4" cols="40"></textarea>
    <br />
    <input type="submit" value="Send Mail" />
    </form>
    </body>
    </html>
    Name sendmail.php

    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>Sendemail Script</title>
    </head>
    <body>
    <!-- Reminder: Add the link for the 'next page' (at the bottom) --> 
    <!-- Reminder: Change 'YourEmail' to Your real email --> 
    <?php
    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;
    }
    if(empty($visitor) || empty($visitormail) || empty($notes )) {
    echo "<h2>Use Back - fill in all fields</h2>\n";
    }
    $todayis = date("l, F j, Y, g:i a") ;
    $attn = $attn ; 
    $subject = $attn; 
    $notes = stripcslashes($notes); 
    $message = " $todayis [EST] \n
    Attention: $attn \n
    Message: $notes \n 
    From: $visitor ($visitormail)\n
    Additional Info : IP = $ip \n
    Browser Info: $httpagent \n
    Referral : $httpref \n
    ";
    $from = "From: $visitormail\r\n";
    
    mail("YourEmail", $subject, $message, $from);
    ?>
    <p align="center">
    Date: <?php echo $todayis ?> 
    <br />
    Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> ) 
    <br />
    Attention: <?php echo $attn ?>
    <br /> 
    Message:<br /> 
    <?php $notesout = str_replace("\r", "<br/>", $notes); 
    echo $notesout; ?> 
    <br />
    <?php echo $ip ?> 
    <br /><br />
    <a href="contact.php"> Next Page </a> 
    </p> 
    </body>
    </html>

  3. #3
    Join Date
    Jul 2006
    Location
    England
    Posts
    610
    Tokens
    0

    Default

    PHP Code:
    <?php
    // Change these two variables to meet your needs.
    $myemail 'EMAIL ADRESS HERE';
    $subject 'EMAIL SUBJECT HERE';
    $op $_POST[op];
    if(
    $op == 'contact')
    {
        
    $name stripslashes($_POST[name]);
        
    $email stripslashes($_POST[email]);
        
    $text stripslashes($_POST[text]);
        
    $referer $_POST[referer];
        
    $remote_host $_SERVER[REMOTE_ADDR];
        
    $server $_SERVER[SERVER_NAME];
        
    $browser $_SERVER[HTTP_USER_AGENT];
        if(!
    eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$email)) 
        { 
            
    $status "We're sorry, but you've entered an incorrect email address.<br>";
        }
        if(!
    $name)
        {
            
    $status .= "Please enter your name.<br>";
        }
        if(!
    $text)
        {
            
    $status .= "Please enter a message.<br>";
        }
        if(!
    $status)
        {
            
    $header "From: $email\r\nReply-To: $email\r\n";
            
    $message "
                Name: 
    $name
                Referer: 
    $referer
                Site: 
    $server
                Remote Host: 
    $remote_host
                Remote Browser: 
    $browser
                
    $text
            "
    ;
            if(
    mail($myemail$subject$message$header))
            {
                
    $status "Thank you for your Feedback!!<br><br>";
            }
            else
            {
                
    $status "There was a problem sending your feedback, please try again later.<br><br>";
            }
        }
        else
        {
            
    $status .= "<br>Please press <u>back</u> on your browser to resubmit.<br><br>";
        }
    }    
    // Now check the referer page and ensure it's a proper URL
    $referer $_SERVER[HTTP_REFERER];
    if(!
    preg_match('#^http\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i'$referer))
    {
        unset(
    $referer);
    }
    ?>
    <?php 
    print $status?>
    <form method="post" action="<?php print $_SELF?>">
    <input type="hidden" name="op" value="contact">
    <input type="hidden" name="referer" value="<?php print $referer?>">
    <font face="Verdana" size="1"> 
    Habbo Name<br>
    <input name="name" size="35" value=""><br>
    E-mail address<br><input name="email" size="35" value=""><br>
    <br>Message<br><textarea name="text" cols="30" rows="10"></textarea><br><br>
    <input type="submit" value="Send"></font>


  4. #4
    Join Date
    Nov 2006
    Location
    i live on my private island!
    Posts
    366
    Tokens
    0

    Default

    ty both of you +rep
    (\_/)
    (o.o) This is Bunny. Copy Bunny to
    ('')('') help him achieve world domination.

  5. #5
    Join Date
    Jul 2006
    Location
    Athens
    Posts
    842
    Tokens
    0

    Default

    Tell me what fields you want and i'll make you one


  6. #6
    Join Date
    Nov 2006
    Location
    i live on my private island!
    Posts
    366
    Tokens
    0

    Default

    could you make one with loads of empty spaces to put the fields in?
    (\_/)
    (o.o) This is Bunny. Copy Bunny to
    ('')('') help him achieve world domination.

  7. #7
    Join Date
    Jul 2006
    Location
    Athens
    Posts
    842
    Tokens
    0

    Default

    The Field names have to comply with the $post names

    What fields do you want and i will make them.

    Also what kind i.e Textarea, Text, checkbox


Posting Permissions

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