Jump to content


Photo

Simple Contact Form


  • Please log in to reply
2 replies to this topic

#1 unstopabl3

unstopabl3
  • Members
  • Pip
  • Newbie
  • 3 posts

Posted 04 March 2006 - 03:28 AM

I would like to manupilate the following lines of code according to my need. I have tried everything and tried many many times but invein i gave up and asking for someones help

$name        = ($_POST['name']);
$email        = ($_POST['email']);
$subject    = ($_POST['subject']);
$msg        = ($_POST['msg']);
$to        = "email@example.com";
$d        = date("D M d, Y h:i:s");
$ip        = getenv("REMOTE_ADDR");
$sub        = "vXdesigns Contact Form";
$headers       .= "From: $name <$to>\n"; 
$headers       .= "X-Sender: $email\n"; 
$headers       .= "X-Mailer: php\n"; 
$headers       .= "X-Priority: 3\n"; 
$headers       .= "Return-Path: $email\n"; 
$headers       .= "Reply-To: $email\n";

now i already know the basics but can someone please explain to me in detail what these header values are and what are they supposed to do. Are there any more values i can use to do different things ???
thanks in advance

Edit by neylitalo: Removed email address for user privacy.

#2 gamefreak13

gamefreak13
  • Members
  • PipPipPip
  • Advanced Member
  • 96 posts

Posted 04 March 2006 - 03:35 AM

Cleaned up..

$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$msg = $_POST['msg'];
$to = "you@email.com";
$d = date("D M d, Y h:i:s");
$ip = $_SERVER['REMOTE_ADDR'];
$sub = "Contact Form";
$headers .= "From: $name <$to>\n"; 
$headers .= "X-Sender: $email\n"; 
$headers .= "X-Mailer: php\n"; 
$headers .= "X-Priority: 3\n"; 
$headers .= "Return-Path: $email\n"; 
$headers .= "Reply-To: $email\n";

The first 4 are the names of the input form fields. The next is your e-mail address. Next is the current date. Then the IP address of the submitter. Then the e-mail subject line. Then who is the e-mail from. What sent you the email. The priority of the email. If you reply, it is sent to this address. If you reply, it is sent to this address.

Hope that all made sense. Its all in order, with each line seperated by a period.

Example of the first 4 lines:

<input type="text" name="name">

so $_POST['name']; is whatever the person enters into that field.

Same with

<input type="text" name="email">

$_POST['email'];

#3 unstopabl3

unstopabl3
  • Members
  • Pip
  • Newbie
  • 3 posts

Posted 04 March 2006 - 02:41 PM

[!--quoteo(post=351509:date=Mar 3 2006, 10:35 PM:name=Gamefreak13)--][div class=\'quotetop\']QUOTE(Gamefreak13 @ Mar 3 2006, 10:35 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Cleaned up..

$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$msg = $_POST['msg'];
$to = "you@email.com";
$d = date("D M d, Y h:i:s");
$ip = $_SERVER['REMOTE_ADDR'];
$sub = "Contact Form";
$headers .= "From: $name <$to>\n"; 
$headers .= "X-Sender: $email\n"; 
$headers .= "X-Mailer: php\n"; 
$headers .= "X-Priority: 3\n"; 
$headers .= "Return-Path: $email\n"; 
$headers .= "Reply-To: $email\n";

The first 4 are the names of the input form fields. The next is your e-mail address. Next is the current date. Then the IP address of the submitter. Then the e-mail subject line. Then who is the e-mail from. What sent you the email. The priority of the email. If you reply, it is sent to this address. If you reply, it is sent to this address.

Hope that all made sense. Its all in order, with each line seperated by a period.

Example of the first 4 lines:

<input type="text" name="name">

so $_POST['name']; is whatever the person enters into that field.

Same with

<input type="text" name="email">

$_POST['email'];
[/quote]

Thx i appreciate your help ):)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users