1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need someone to code me a contact form

Discussion in 'Hire a Freelancer' started by imontie, Oct 22, 2009.

  1. imontie

    imontie Junior Member

    Joined:
    Jan 22, 2009
    Messages:
    166
    Likes Received:
    64
    I can't fucking get this contact us form to work.. I've never used a legitimate one and now I actually need one so I need someone to help me create it.

    PM me with details. I need two of these done.
     
  2. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,884
    Likes Received:
    1,932
    My Form:

    PHP:
    <?php
    $adminemail 
    "admin@xxx.com";
    $subject "YourDomain.com Enquiry";

    if (isset(
    $_POST["contact"]) && $_POST["contact"] == "1") {
        
    $message $_POST['message'];
        
    $name $_POST['name'];
        
    $email $_POST['email'];
        
    $error1 "<p><b>You Forgot To Enter Your Name</b></p>";
        
    $error2 "<p><b>You Forgot To Enter Your Email Address</b></p>";
        
    $error3 "<p><b>You Forgot To Enter A Message</b></p>";
        
    $success "<p><b>Your Message Been Submitted. Please Allow Up To 48 Hours For A Response</b></p>";
        
        if (
    $name==""){$error=$error1;}
        if (
    $email==""){$error=$error2;}
        if (
    $message==""){$error=$error3;}
        
        if (
    $name&&$email&&$message!=""){
            if (
    $error==""){
                 
    $to $adminemail;
                
    $subject $subject;
                
    $header "From: $name<$email>\n";
                
    $header .="Content-type: text/html; charset=iso-8859-1\n";
                
    $header .= "Reply-To: <$email>\n";
                
    $header .= "X-Sender: <$email>\n";
                
    $header .= "X-Mailer: PHP4\n";
                
    $header .= "X-Priority: 3\n";
                
    $header .= "Return-Path: <$email>\n";
                
    $body $message;
                
    $error=$success;
                
    mail($to$subject $body$header);
                }
            }
        }
    ?>


    <form id="form1" method="post" action="">
      <input type="hidden" name="contact" value="1"/>
      <p>
        <label>Your Name:
          <input name="name" type="text" id="name" value="<?php echo $name?>" />
        </label>
      </p>
      <p>
        <label>Your Email Address:
          <input name="email" type="text" id="email" value="<?php echo $email?>" />
        </label>
      </p>
      <p>
        <label>Your Message:
          <br/>
          <textarea name="message" id="message" cols="45" rows="5">
          </textarea>
        </label>
      </p>
      <?php echo $error?>
        <p>
          <label>
            <input class="contactbutton" type="submit" name="submit" id="submit" value="Submit"/>
          </label>
        </p>
    </form>

    (Click Select All To See The HTML In The Code)
     
    • Thanks Thanks x 2
  3. imontie

    imontie Junior Member

    Joined:
    Jan 22, 2009
    Messages:
    166
    Likes Received:
    64
    Thanks bro.
     
  4. kae77

    kae77 Newbie

    Joined:
    Oct 19, 2009
    Messages:
    18
    Likes Received:
    6

    how this will work..?
    any demo.?