# Help Php form mailer sending empty emails

**URL:** <https://forum.kirupa.com/t/help-php-form-mailer-sending-empty-emails/131181>\
**Category:** Uncategorized\
**Created:** [December 13, 2004, 3:42am UTC](https://forum.kirupa.com/t/help-php-form-mailer-sending-empty-emails/131181 "2004-12-13T03:42:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tpreska](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@tpreska](https://forum.kirupa.com/u/tpreska)\
**Post date:** [December 13, 2004, 3:42am UTC](https://forum.kirupa.com/t/help-php-form-mailer-sending-empty-emails/131181/1 "2004-12-13T03:42:42Z")

</div>

Hi I am having a hard time get this form to email back results.

the form is here [www.preska.net/milsurvey.html](http://www.preska.net/milsurvey.html) I tried to post the html but i had an error before. It has text text area radio and checkboxes

the php is the code off of your site modified

```php
<?PHP 
 $to = "tom@preska.net"; 
 $subject = "Results from Military survey"; 
 $headers = "From: My Site";
 $forward = 1;
 $location = "thanks.html";  
 $date = date ("l, F jS, Y"); 
 $time = date ("h:i A"); 
 
 $msg = "Below is the result of your feedback form. It was submitted on $date at $time.

"; 
 
 if ($_SERVER['REQUEST_METHOD'] == "POST") {
 	foreach ($_POST as $key => $value) { 
 		$msg .= ucfirst ($key) ." : ". $value . "
"; 
 	}
 }
 else {
 	foreach ($_GET as $key => $value) { 
 		$msg .= ucfirst ($key) ." : ". $value . "
"; 
 	}
 }
 
 mail($to, $subject, $msg, $headers); 
 if ($forward == 1) { 
 	header ("Location:$location"); 
 } 
 else { 
 	echo "Thank you for submitting our form. We will get back to you as soon as possible."; 
 } 
 
 ?>

```

I get emails back with the php info but I don’t get any of the form data?

Thanks for your help!
