Need someone to code me a contact form

Status
Not open for further replies.

imontie

Junior Member
Joined
Jan 22, 2009
Messages
166
Reaction score
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.
 
My Form:

PHP:
<?php
$adminemail = "[email protected]";
$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)
 
My Form:

PHP:
<?php
$adminemail = "[email protected]";
$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)


how this will work..?
any demo.?
 
Status
Not open for further replies.
This thread has been auto closed due to the forum's thread age policy. Read more.
Back
Top