php mail form
- Started
- Last post
- 11 Responses
- Seff
can someone help me figure out how to get the name to post in the header of the email that is sent?
this is the code i am using and the name default comes in as 'nobody'
Nobody ...this is code i am using
[?php
if(isset($_POST['submit'])) {$to =
$subject = "Contact Page";
$name = $_POST['name'];
$email = $_POST['email'];
$check_careers = $_POST['check_careers'];
$check_brands = $_POST['check_brands'];
$check_careers = $_POST['check_careers'];
$comments = $_POST['comments'];$body = "
Name:
$nameEmail:
$emailI am interested in:
Careers:
$check_careersBrands:
$check_brandsSports:
$check_sportsComments:
$comments";header("Location: http://www.fusionista.com/client…
mail($to, $subject, $body);} else {
echo "blarg!";
}
?]
- cosmo0
header of the email?
- unfittoprint0
+ headers: http://pastecode.com/3900
- Seff0
love you guyses
- Seff0
what does this error mean?
Parse error: syntax error, unexpected T_VARIABLE in /home/fusionis/public_html/clien... on line 4
- unfittoprint0
you duplicated $check_careers, replacing $career_sports.
that's the 'unexpected' var with no value assigned.
refresh: http://pastecode.com/3906
- Seff0
thanks again man!
always the obvious i never see
- Seff0
this is sending the mail, but now it puts the body contents all on one line in the email and does not bring up the thanks page..
help?
- unfittoprint0
change:
Content-Type: text/html;
to:
Content-Type: text/plain;
If you want to send html mails [I only send those types] you might want to keep my code and add something like:
$body = nl2br($body);
before the mail() function.
- Seff0
sweet!
the mails looks good, but the website does not bring up the thanks page after the form is submitted, just sits on the process.php page
- Seff0
got the thing working now.
cheers unfit
yer mighty mighty