PHP form mailer - foreach() problem

hi, a real newbie here. But I found the site interesting and haven’t stopped looking at everything. It’s great. Okay now I go that out of the way, I am trying to use the PHP form mail from the Kirupa site. Well it sends me an email with nothing but “Below is the result of your feedback form. It was submitted on Monday, March 22nd, 2004 at 01:08 PM.” and thats it. Of course the subject and everything else work.

The other thing is once I click on the submit button I get this message come up.

Warning: Invalid argument supplied for foreach() in /usr/local/etc/httpd/vhosts/domain.com/mysite/mailer.php on line 21
Thank you for submitting our form. We will get back to you as soon as possible.

of course i have changed my domain name above in that message to a generic one like domain.com.

anyhow I go to the mailer.php file and check line 21.

foreach ($_GET as $key => $value) { 

and that is what it says.

now here is the whole page of code. again i have changed the email address to generic ones.

<?PHP
$to = "email@address.com";
$subject = “Form from website”;
$headers = “From: address.com”;
$forward = 0;
$location = “”;

$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.”;
}

?>

if anyone could help me out that would be great.
Thanks. Oh and I am using a HTML form.

Wolfie