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@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";
[/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
Share on other sites

Cleaned up..

[code]$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";[/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
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 = "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";[/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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.