Email form is not sending the information

Hi,
 there is no syntax error,
I am receiving the email form , but no information that is in the fields is going thru, can't figure that out.

<?php 
if(array_key_exists('send',$_POST)){
	$to = 'circleimage@gmail.com';
	$subject = 'Feedback from summer rain wellness page';
	//list expected fields
	$expected = array('name','email','comments');
	//setrequired fields
	$required = array('name','comments');
	//create empty array for missing fields
	$missing = array();
	
	//process the $_POST variables
	foreach($_POST as $key => $value) {
		//assign to temporary variable bd strip whitespace if not an array
		$temp = is_array($value) ? $value : trim($value);
		// if empty and required add to $missing array
		if (empty($temp) && in_array($key,$required)){
			array_push($missing,$key);
		}
		//otherwise, assign to a variable of the same name as $key
		elseif (in_array($key,$expected)){
			${key}= $temp;
		}
	}

	//go head only if all required fileds OK
	if(empty($missing)){
	//build the message
	$message = "Name: $name\n\n";
	$message .= "Email: $email\n\n";
	$message .= "Comments: $comments";
	
	//limit line length to 70 characters
	$message = wordwrap($message,70);
	
	//sent it
	$mailSent = mail($to, $subject, $message);
	if ($mailSent){
		//$missing is no longer needed if the email is sent so unset it 
		unset($missing);
	}
	}
}
?>
<!DOCTYPE HTML>
<head>
<title>summer rain wellness</title>

<link href="css/contactStyle.css" rel="stylesheet" type="text/css">
</head>
<body>

<div id="header">
    <h1>Summer Rain Wellness</h1>
</div>
<div id="wrapper">
<?php include('includes/menu.inc.php'); ?>

    <div id="maincontent">
      <h2>Contact Us </h2>
      <?php
	  if ($_POST && isset($missing) && !empty($missing)){
		  ?>
          <p class="warning">Please complete  the missing items(s) indicated.</p>
          <?php
	  }
	  elseif ($_POST && !$mailSent) {
		  ?>
          <p class="Warning">Sorry, there was problem sending your message Please try later</p>
          <?php }
		  elseif($_POST && $mailSent){
		   ?>
      <p><Strong>Your message been sent.Thank you "young jedi" for your response!</Strong></p>
      <?php } ?>
        <form id="feedback" method="post" action="">
            <p>
                <label for="name">Name:<?php
                if(isset($missing) && in_array('name',$missing)){ ?>
                <span class ="warning">Please enter your name</span><?php } ?>
                </label>
                <input name="name" id="name" type="text" class="formbox">
            </p>

Open in new window


and here is also the form:

<form id="feedback" method="post" action="">
            <p>
                <label for="name">Name:<?php
                if(isset($missing) && in_array('name',$missing)){ ?>
                <span class ="warning">Please enter your name</span><?php } ?>
                </label>
                <input name="name" id="name" type="text" class="formbox">
            </p>
            <p>
                <label for="email">Email:</label>
                <input name="email" id="email" type="text" class="formbox">
            </p>
            <p>
                <label for="comments">Comments:</label>
              <textarea name="comments" id="comments" cols="60" rows="8"></textarea>
            </p>
            <p>
                <input name="send" id="send" type="submit" value="Send message">
            </p>
        </form>

Open in new window

imagekrazyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
${key}= $temp;

should be

${$key}= $temp;

You may want to add a FROM parameter.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
imagekrazyAuthor Commented:
Wow I can't believe something as simple of leaving something out cause  a major  headache.

Thank you!
 Just want to know how do i catch errors like that if the editor tells me nothing is wrong?
GaryCommented:
Add the following at the top of your code

error_reporting(E_ALL);
imagekrazyAuthor Commented:
within the php tag or above it?
GaryCommented:
Just after your first opening php tag
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.