email form/php

Okay, can't figure this out, I got the email form to work  from my previous post, I changed a few things up, and now the email form  its not sending me the information from the new email form that  i changed,  there is no errors and my thank you page  is stating that the information was sent.

<?php
include('includes/title.inc.php');
$errors = array();
$missing = array();
// check if the form has been submitted
if (isset($_POST['send'])) {
  // email processing script
  $to = 'circleimage@gmail.com';
  $subject = 'Feedback from test site';
  // list expected fields
  $expected = array('name', 'email', 'comments', 'injuryType', 'howhear');
  // set required fields
  $required = array('name', 'comments', 'email', 'injuryType', 'howhear');
  
  // set default values for variables that might not exist
 
  if (!isset($_POST['injuryType'])) {
	$_POST['injuryType'] = array();
  }
 
  // minimum number of required check boxes
  $minCheckboxes = 1;
  if (count($_POST['injuryType']) < $minCheckboxes) {
	$errors['injuryType'] = true;
  }

  // create additional headers
 $headers = "From: test site<circleimage@gmail.com>\r\n";
 $headers .= 'Content-Type: text/plain; charset=utf-8';
 require('includes/processmail.inc.php');
 if ($mailSent) {
	header('Location: http://www.myvebsite.com/test/thank_you.php');
	exit;
 }
}
?>

Open in new window


the form:
<?php if (($_POST && $suspect) || ($_POST && isset($errors['mailfail']))) { ?>
          <p class="warning">Sorry, your mail could not be sent. Please try later.</p>
        <?php } elseif ($missing || $errors) { ?>
           <p class="warning">Please fix the item(s) indicated.</p>
        <?php } ?></p>
<form id="feedback" method="post" action="">
		<p><label for="select">How did you hear about Tracy Laufer?
                <?php if ($missing && in_array('howhear', $missing)) { ?>
              
                <?php } ?>
                </label>
			<select name="howhear" id="howhear">
					<option value=""
					<?php
					if (!$_POST || $_POST['howhear'] == '') {
					  echo 'selected';
					}
					 ?>
                     >Select one</option>
					<option value="Referral"
					<?php
					if ($_POST && $_POST['howhear'] == 'Referral') {
					  echo 'selected';
					}
					 ?>
                     >Referral</option>
					<option value="Search Engines"
					<?php
					if ($_POST && $_POST['howhear'] == 'Search Engines') {
					  echo 'selected';
					}
					 ?>
                     >Search Engines</option>
					<option value="Radio"
					<?php
					if ($_POST && $_POST['howhear'] == 'Radio') {
					  echo 'selected';
					}
					 ?>
                     >Radio</option>
					<option value="NewsPaper"
					<?php
					if ($_POST && $_POST['howhear'] == 'NewsPaper') {
					  echo 'selected';
					}
					 ?>
                     >NewsPaper</option>
				</select>
         </p>
            <p>
                <label for="name">Name:
                <?php if ($missing && in_array('name', $missing)) { ?>
                  <span class="warning">Please enter your name</span>
                <?php } ?>
                </label>
                <input name="name" id="name" type="text" class="formbox"
                <?php if ($missing || $errors) { 
                 echo 'value="' . htmlentities($name, ENT_COMPAT, 'UTF-8') . '"';
                } ?>>
            </p>
            <p>
                <label for="email">Email:
                <?php if ($missing && in_array('email', $missing)) { ?>
                  <span class="warning">Please enter your email address</span>
                <?php } elseif (isset($errors['email'])) { ?>
                  <span class="warning">Invalid email address</span>
                <?php } ?>
                </label>
                <input name="email" id="email" type="text" class="formbox"
                <?php if ($missing || $errors) { 
                 echo 'value="' . htmlentities($email, ENT_COMPAT, 'UTF-8') . '"';
                } ?>>
            </p>
            <p><h2>Please enter your comments</h2>
                <label for="comments">
                <?php if ($missing && in_array('comments', $missing)) { ?>
                  
                <?php } ?>
                </label>
                <textarea name="comments" id="comments" cols="60" rows="8"><?php
                if ($missing || $errors) {
                  echo htmlentities($comments, ENT_COMPAT, 'UTF-8');
                } ?></textarea>
	        </p><br><br>
		
			<fieldset id="injuryType">
			<h2>Please select the type of injury.
            <?php if (isset($errors['injuryType'])) { ?>
             <?php echo $minCheckboxes; ?>
            <?php } ?>
            </h2>
			<div>
			<p>
				<input type="checkbox" name="injuryType[]" value="Neck" id="neck" 
				<?php
				if ($_POST && in_array('Neck', $_POST['injuryType'])) {
				  echo 'checked';
				} ?>>
				<label for="exercising">Neck</label>
			</p>
			<p>
				<input type="checkbox" name="injuryType[]" value="Back" id="back" 
				<?php
				if ($_POST && in_array('Back', $_POST['injuryType'])) {
				  echo 'checked';
				} ?>>
				<label for="back">Back</label>
			</p>
			
			</p>
			</div>
			</fieldset>
            <p>
	

			</p>
			<p>
				
			</p>
            
            <p>
                <input name="send" id="send" type="submit" value="Send message"><INPUT TYPE="RESET" VALUE="Reset">
            </p>
           
        </form>

Open in new window

imagekrazyAsked:
Who is Participating?
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.

dimmergeekCommented:
How can you set a POSTed object to equal an array?

$_POST['injuryType'] = array();

Open in new window

0

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
Ray PaseurCommented:
$_POST['injuryType'] = array();

Nothing wrong with that at all; it's just a variable assignment.  Probably there is a logic error somewhere else in the script.

Start by putting error_reporting(E_ALL); right at the top of your scripts.  Do this EVERY TIME.  Then run it again and see if there is any Notice from PHP.  Please post those notices here, thanks.
0
imagekrazyAuthor Commented:
your right it was logic error, I corrected  and it works fine----> $_POST['injuryType] = '';
thank you both
0
imagekrazyAuthor Commented:
thank you
0
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.