Jump to content

Simple Contact Form


unstopabl3

Recommended Posts

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

[code]
$name        = ($_POST['name']);
$email        = ($_POST['email']);
$subject    = ($_POST['subject']);
$msg        = ($_POST['msg']);
$to        = "[email protected]";
$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";
[/code]

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

[b]Edit by neylitalo:[/b] Removed email address for user privacy.
Link to comment
https://forums.phpfreaks.com/topic/4061-simple-contact-form/
Share on other sites

Cleaned up..

[code]$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$msg = $_POST['msg'];
$to = "[email protected]";
$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";[/code]

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'];
Link to comment
https://forums.phpfreaks.com/topic/4061-simple-contact-form/#findComment-14078
Share on other sites

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

[code]$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$msg = $_POST['msg'];
$to = "[email protected]";
$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";[/code]

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 ):)
Link to comment
https://forums.phpfreaks.com/topic/4061-simple-contact-form/#findComment-14158
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.