My form doesn't send the requested fields to my email

I have a problem for hours now, i have made a form in html and the make a send.php to email it to me, but it doesn’t send email so i hope that some one can help me with this problem.

[php]<?php

/* subject and email variables */

$emailSubject = 'CM Application Form';
$webMaster = '[email protected]';

/* Gathering Data Variables */

$completename - $_POST ['completename'];
$month - $_POST ['month'];
$day - $_POST ['day'];
$year - $_POST ['year'];
$adress1 - $_POST ['address1'];
$adress2 - $_POST ['address2'];
$city - $_POST ['city'];
$state - $_POST ['state'];
$country - $_POST ['country'];
$email - $_POST ['email'];
$skype - $_POST ['skype'];
$country1 - $_POST ['country1'];
$yes - $_POST ['yes'];
$month1 - $_POST ['month1'];
$day1 - $_POST ['day1'];
$factor - $_POST ['factor'];
$yes1 - $_POST ['yes1'];
$yes2 - $_POST ['yes2'];
$yes3 - $_POST ['yes3'];
$texarea1 - $_POST ['textarea1'];
$yes4 - $_POST ['yes4'];
$texarea2 - $_POST ['textarea2'];
$yes5 - $_POST ['yes5'];
$texarea3 - $_POST ['textarea3'];
$texarea4 - $_POST ['textarea4'];
$status - $_POST ['status'];
$texarea5 - $_POST ['textarea5'];




$body = "





Completename: $completename

Date of Birth: $month $day $year

Address1: $address1

Address2: $address2

City: $city

State: $state

Country: $country

Email: $email

Skype Id: $skype

The country you want to be a Country Manager of: $country1

Are you a member of WAZZUB, PerfectInter.net: $yes

If YES, please provide the date you first became a member. : $month1 $day1

What is your current Factor: $factor

Do you write and speak fluently in your native language: $yes1

Do you write and speak fluently in English: $yes2

Can you commit to give online Support to your Countrymen in the WAZZUB Community at a minimum of 3 days per week - 1 hour per day? $yes3

If you have provided any support to members please state where and how & also provide links to your support materials e.g blogs etc: $textarea1

Can you commit to translate needed documents on a timely fashion from English to your native language on an ongoing basis as the company requires? $yes4

Education Back Ground: $textarea2

Do you have management skills? $yes5

In no less than 100 words describe your professional background: $textarea3

In no less than 100 words describe your social background and activities: $textarea4

What is your overall health status? $status

In NO LESS than 100 words, explain what do you believe makes you the best candidate for this position? $textarea5

";
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);

/* Results Rendered as HTML */

$theResults = "
CM Application Form

body {
background-color: white;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 18px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: black;
text-decoration: none;
}
–>

Your content has been send! thank you for filling out the form.
"; echo "$theResults";

?>[/php]

Many thanks

Try this for headers:

[php]
$headers = “Mime-Version: 1.0\r\n”;
$headers .= “Content-type: text/html; charset=iso-8859-1”;
$headers .= “From: {$email}\r\n”;
$headers .= “To: {$webMaster}\r\n”;
$headers .= “Subject: {$emailSubject}\r\n”;
[/php]

Also put this at the very start after the opening <?php tag:

[php]
ini_set(‘display_errors’, ‘On’);
error_reporting(-1);
[/php]

Thnx for your answer and help.
Now i have all the variables are errors.

But the fieldname in the html file are the same.

this is the error:
Undefined variable: textarea5 in

For all variables.

here is a picture of the errors :

this is the picture

I dont know what is means or how i can solve this…

please can some one help…

I fixed all the errors their were some typos, but no email was send it says it is succesfully send but no email in my inbox.

Does someone know what i miss in this form.

Thanks allot…

well, for starters change;

$completename - $_POST [‘completename’];

to

$completename = $_POST [‘completename’];

and all the rest too!

Yes i did that allready.

But the form will not send to my email.

So thats the only problem left to solve.

I hope you can help me.

I can’t send email through php on my local box. I guess I don’t have sendmail configured. But it works fine once uploaded to my server. Is this local or server? Is sendmail configured properly?

What do your PHP error logs say? Also by some bizarre chance did you check your spam folder in email?

Check spam. It is common for emails sent with this to goto spam boxes.

Hello,

Thanks for your answer, i looked into my spam box but nothing there.

So i don´t know what is wrong, also no errors as well.

I hope some one can help me to get this form to send a email.

This form is already on the server, so i dont know what i did wrong, hope someone can help me.

this is the error i get from line 14 to line 40 Notice: Undefined index:

Can some one help me to solve this problem

this is the code that gives errors

/* Gathering Data Variables */

$completename = $_POST['completename'];
$month = $_POST['month'];
$day = $_POST['day'];
$year = $_POST['year'];
$address1 = $_POST['address1'];
$address2 = $_POST['address2'];
$city = $_POST['city'];
$state = $_POST['state'];
$country = $_POST['country'];
$email = $_POST['email'];
$skype = $_POST['skype'];
$country1 = $_POST['country1'];
$yes = $_POST['yes'];
$month1 = $_POST['month1'];
$day1 = $_POST['day1'];
$factor = $_POST['factor'];
$yes1 = $_POST['yes1'];
$yes2 = $_POST['yes2'];
$yes3 = $_POST['yes3'];
$textarea1 = $_POST['textarea1'];
$yes4 = $_POST['yes4'];
$textarea2 = $_POST['textarea2'];
$yes5 = $_POST['yes5'];
$textarea3 = $_POST['textarea3'];
$textarea4 = $_POST['textarea4'];
$status = $_POST['status'];
$textarea5 = $_POST['textarea5'];

does your HTML form that calls this PHP file contain a named element that corresponds with every $_Post item? Check spelling!

All the fields have the same name in Html as in PHP

I can send the files but it must be in private, but if you can help please i wil be happy and greatfull :smiley:

[code]

[/code]

this is a bit of html as a example.

Complete Name*:

No i get a email but it wil not show in html.

i get it like this




Completename: Erwin Noever
Date of Birth: 1 1 2007
Address1: erwerwer
Address2:
City: Rotterdam
State: None
Country: Afganistan
Email: [email protected]
Skype Id: erwin.noever
The country you want to be a Country Manager of: Angola
Are you a member of WAZZUB, PerfectInter.net: yes
If YES, please provide the date you first became a member. : 6 14
What is your current Factor: 20
Do you write and speak fluently in your native language: yes1
Do you write and speak fluently in English: yes2
Can you commit to give online Support to your Countrymen in the WAZZUB Community at a minimum of 3 days per week - 1 hour per day? yes3
If you have provided any support to members please state where and how & also provide links to your support materials e.g blogs etc: sadjgfsdkljgfsdjklgsdjk
Can you commit to translate needed documents on a timely fashion from English to your native language on an

How can i fix that.

add “Content-type: text/html\r\n” to your header string. Like ‘$headers .= “Content-type: text/html\r\n”;’

the email now send good. I only must look for how to attache a uploaded document to the email, thats something i realy dont know how and which code to use, i’m just a starter at PHP, but i love it.

I hope someone can help me to attache a image to the email when the form wil be send.
:smiley:

I said that already. didn’t you read?

Sponsor our Newsletter | Privacy Policy | Terms of Service