# PHP Email Form Problem?

**URL:** <https://forum.kirupa.com/t/php-email-form-problem/28416>\
**Category:** programming\
**Created:** [August 13, 2003, 3:53pm UTC](https://forum.kirupa.com/t/php-email-form-problem/28416 "2003-08-13T15:53:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fantim](https://avatars.discourse-cdn.com/v4/letter/f/cc9497/32.png) [@fantim](https://forum.kirupa.com/u/fantim)\
**Post date:** [August 13, 2003, 3:53pm UTC](https://forum.kirupa.com/t/php-email-form-problem/28416/1 "2003-08-13T15:53:09Z")

</div>

Can you guys check out this script and tell me if I got everything right. For some reason it’s e-mailing me, but not all the variables that I want. I’m only getting an e-mail with a subject of FANTIMdotORG with no from address or anything like that.

```php

<? 

// Recieving and Creating Variables... 
$Name = $_POST['name']; 
$Email = "fantim@myrealbox.com"; 
$Message = $_POST['message']; 
$Subject = "FANTIMdotORG"; 
$Addy = $_POST['addy'];
$Header = "From: $Name <$Addy>"; 

//Performing Mail script... 
mail($Email, $Subject, $Message, $Header); 

?>

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 13, 2003, 5:40pm UTC](https://forum.kirupa.com/t/php-email-form-problem/28416/2 "2003-08-13T17:40:38Z")

</div>

well you’re only telling the script to send the variable $Message. YOu don’t define anything else that is supposed to be contained within Message.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 13, 2003, 5:59pm UTC](https://forum.kirupa.com/t/php-email-form-problem/28416/3 "2003-08-13T17:59:50Z")

</div>

yup you need to include $Addy in your $Message

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 13, 2003, 6:03pm UTC](https://forum.kirupa.com/t/php-email-form-problem/28416/4 "2003-08-13T18:03:29Z")

</div>

and $name… :sigh:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 13, 2003, 11:10pm UTC](https://forum.kirupa.com/t/php-email-form-problem/28416/5 "2003-08-13T23:10:25Z")

</div>

```php

<?php
 
   $to = "youremail@domain.com";
	 
                 $msg = "Name: $name

";
	 $msg .= "E-mail: $email

";
	 $msg .= "Phone: $phonenumber

";
                 $msg .= "Message: $message

";

  mail($to, $subject, $msg, "From: YourHomeSite
Reply-To: $email
");
	
?>

```

That’s it.

In your Flash you have to have fields, with variable names:

name

subject

email

phonenumber

message

the “send” button has to have the following code:

```php

on (release) {
		loadVariablesNum("mymailform.php", 0, "POST");
	}

```

That should do the trick. It’s as simple as it gets, 'cause I got the impression you’re not very experienced in doing something with php. Neither am I 🙂

Remember that this code does absolutely no checking whether the mail as sent or not. I recommend that you write a check bit in there also.

Shouldn’t be too hard, but I left something for you to solve too 🙂

Hope that helps.
