# Please help my contact form

**URL:** <https://forum.kirupa.com/t/please-help-my-contact-form/267615>\
**Category:** Uncategorized\
**Created:** [August 4, 2008, 3:41am UTC](https://forum.kirupa.com/t/please-help-my-contact-form/267615 "2008-08-04T03:41:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chrysant](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@Chrysant](https://forum.kirupa.com/u/Chrysant)\
**Post date:** [August 4, 2008, 3:41am UTC](https://forum.kirupa.com/t/please-help-my-contact-form/267615/1 "2008-08-04T03:41:39Z")

</div>

I was confused about the contact form. I wanted some changes on the form. The new form contains more variable. It’s not just name, email, and message. There is name, shipping address, zipcode, state, country, phone, and message.

While editing the php file, I didn’t know how to input the other variables. The old php files was looked like this:

\<?php  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \*\

- PHP 4.1.0+ version of email script. For more
- information on the mail() function for PHP, see
- [http://www.php.net/manual/en/function.mail.php](http://www.php.net/manual/en/function.mail.php)  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \*\*/

$sendTo = “email@.com”;  
$subject = “Mail from the site”;

$headers = “From: " . $\_POST[“firstName”] .” “. $\_POST[“lastname”] . “\<” . $\_POST[“email”] .”\>  
";  
$headers .= "Reply-To: " . $\_POST[“email”] . "  
";  
$headers .= "Return-path: " . $\_POST[“email”];

$message = $\_POST[“message”];

mail($sendTo, $subject, $message, $headers);

?\>

Where can I put the other variables? I want to put it in body message. The message body would look like this:

NAME:  
blablabla  
EMAIL:  
blablabla  
SHIPPING ADDRESS:  
blablabla  
ZIPCODE:  
blablabla  
STATE:  
blablabla  
PHONE:  
blablabla  
MESSAGE:  
blablabla

The old php file didn’t give the name (even there is php scripts about name). There was just email address on the “From” space. It was okay. But now, I want to make the name appears in the message body.

I know php very little. So, I don’t know how to add some additional php script.  
My assumtion is, it would be like result flash script below:

result.text+= "NAME:  
"+name;  
result.text+= "EMAIL:  
"+email;  
result.text+= "SHIPPING ADDRESS:  
"+shipping;  
result.text+= "ZIPCODE:  
"+zipcode;  
result.text+= "STATE:  
"+state;  
result.text+= "COUNTRY:  
"+country;  
result.text+= "PHONE:  
"+phone;  
result.text+= "MESSAGE:  
"+message;

But I don’t know how is it in php.

So please, anyone, if you have time to reply me, I would be very grateful. Ok, then, thanks before.

Chrys

ps. The tutorial i used: - _Flash-Based Email Form Using PHP_ by Senocular  
- _Using Components to Create a Form_ by Pom
