# Help with form mailer. PHP

**URL:** https://forum.kirupa.com/t/help-with-form-mailer-php/202336
**Category:** programming
**Created:** [September 29, 2006, 7:55pm UTC](https://forum.kirupa.com/t/help-with-form-mailer-php/202336 "2006-09-29T19:55:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MelissaM](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@MelissaM](https://forum.kirupa.com/u/MelissaM)
#### Post date: [September 29, 2006, 7:55pm UTC](https://forum.kirupa.com/t/help-with-form-mailer-php/202336/1 "2006-09-29T19:55:54Z")

</div>

Hi… I am needing help… I dont know anything about PHP. I was wondering if someone could be so grateful as to help me.

I am making this website for my boss. [http://www.stlsportsphoto.com](http://www.stlsportsphoto.com)

The form on [[COLOR=#0000ff]Your Favorite Team’s E-Mail Notification[/COLOR]](http://stlsportsphoto.com/inforequest.htm) page is not working. I used a code that I got off of this site.

I keep getting the following error message when I submit the form.

**Parse error** : parse error, unexpected T\_STRING in **/home/www/stlsportsphoto.com/mailer.php** on line **8**

I have a simple html form… set with action=“mailer.php”

The mailer.php file is as follows:

```php
 
<?PHP 
$to = "stlcardinalgirl@yahoo.com";
$subject = "Results from Team Notification Form";
$headers = "From: My Site";
$forward = 1;
$location = "stlsportsphoto.com/mailform/thankyou.htm;
$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."; 
} 
?>

```

Can someone please offer me any kind of assistance???

Thanks so much!!!

Melissa
