PHP Form help to a newbie

Hope someone can help. I’m not a novice in PHP. I hv the form showwen below. If you scroll down you will see the input radio and checkboxes. I’m hving trouble when I send my self the email with confirmation to show what ever is checked off. can someone help pls?

[code]include_once(‘config.php’);
include_once(‘functions.php’);

//If contact is being sent:
if($_POST[‘submit_id’] == 1){

//Check fname entered
if($_POST['fname'] == NULL){ $message = 'Please enter your first name.';}

//Check lname entered
if($_POST['lname'] == NULL && $message == NULL){ $message = 'Please enter your last name.';}

//Check business name entered
//if($_POST['busname'] == NULL && $message == NULL){ $message = 'Please enter your business or organization name.';}

//Check address1 entered
if($_POST['address1'] == NULL && $message == NULL){ $message = 'Please enter a address.';}

//Check address2 entered
//if($_POST['address2'] == NULL && $message == NULL){ $message = 'Please enter a address.';}

//Check City entered
if($_POST['city'] == NULL && $message == NULL){ $message = 'Please enter your city.';}

//Check zip code entered
if($_POST['zip'] == NULL && $message == NULL){ $message = 'Please enter your zip code.';}

//Check home phone entered
if($_POST['hphone'] == NULL && $message == NULL){ $message = 'Please enter your home phone.';}

//check if email is enetered
if($message == NULL && is_valid_email($_POST['email']) == false ){ $message = 'Please enter a valid email.';}

//Check User web name entered
//if($_POST['webname'] == NULL && $message == NULL){ $message = 'Please enter your web name.';}

//Check target amount entered
//if($_POST['target'] == NULL && $message == NULL){ $message = 'Please enter your Fundraising target amount.';}

//check if message is entered
if($_POST['message_text'] == NULL && $message == NULL){ $message = 'Please enter List/description of ietms to pick up.';}

//check if message is entered
//if($_POST[‘agreem’] == NULL && $message == NULL){ $message = ‘Please check off you have read and agree to the Disclaimer terms.’;}

//check if image entered
//if($_FILES['user_file'][name] == NULL && $message == NULL){ $message = 'Please enter a file to upload.';}

//File Upload checks
if($message == NULL && $FILE_UPLOAD == 1 && $_FILES['user_file']['name'] != NULL){
if($_FILES['user_file']['size'] > (($FILE_UPLOAD_MAX*1024)*1024)){ $message = 'File is over '.$FILE_UPLOAD_MAX.' MB in size.';}
if($message == NULL && allowed_ext($FILE_UPLOADS_EXT,$_FILES['user_file']['name']) == false){$message = 'Invalid extension.';}
$new_filename = date("G_i_s_").$_FILES['user_file']['name'];}

//Image verificaiton checks

if($message == NULL && $IMAGE_VERIFICATION == 1){
	$te_co = hex2bin($_POST['hid_code']);
	$word_is = RC4($te_co,$IMAGE_VER_CODE);
	if($word_is != $_POST['confirm_image']){$message = 'Your verfication code is incorrect.';}
}

//End verifications, start processing
if($message == NULL){

	//Check if file upload is needed
	if($FILE_UPLOAD == 1 && $_FILES['user_file']['name'] != NULL){

		//Store file for keep and email
		move_uploaded_file($_FILES['user_file']['tmp_name'],$FILE_UPLOADS_DIR.$new_filename);
	}

	//compose admin/user message templates replaces
$do_search = array(	'$+fname+$','$+lname+$','$+address1+$','$+address2+$','$+city+$','$+state+$','$+zip+$','$+hphone+$','$+wphone+$','$+email+$','$+message_text+$','$+search_engine+$','$+ptstore+$','$+friend+$','$+other+$','$+agreem+$','$+add_info+$');
	$do_replace = array($_POST['fname'],$_POST['lname'],$_POST['address1'],$_POST['address2'],$_POST['city'],$_POST['state'],$_POST['zip'],$_POST['hphone'],$_POST['wphone'],$_POST['email'],$_POST['message_text'],$_POST['search_engine'],$_POST['ptstore'],$_POST['friend'],$_POST['other'],$_POST['agreem'],$_POST['add_info']);

	//Send user email?
	if($SEND_THANKS == 1){
		$user_message = str_replace($do_search,$do_replace,$USER_TEMPLATE);

		//Set Headers
		$user_header = "Return-Path: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">rn";
		$user_header .= "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">rn";
		$user_header .= "Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=".$EMAIL_OPTIONS['CHARSET'].";nnrn";

		//Send Thank you
		mail ($_POST['email'],$EMAIL_OPTIONS['USER_SUBJECT'],$user_message,$user_header);
	}

	//Send admi email?
	if(count($ADMIN_EMAILS) > 0){
		$admin_message = str_replace($do_search,$do_replace,$ADMIN_TEMPLATE);

		//Do we need to send file as attachment?
		if($FILE_DO != 1){

			//Get file attriubtes
			$fileatt_type = $_FILES['user_file']['type'];
			$file = fopen($FILE_UPLOADS_DIR.$new_filename,'rb');
			while($dat = fread($file,1025657)){
				$attachment_data .= $dat;
			}

			fclose($file);

			// Encode file content
			$attachment_data = chunk_split(base64_encode($attachment_data));

			//File upload headers
			$semi_rand = md5(time());
			$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
			$headers = "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">";

			// Add the headers for a file attachment
			$headers .= "nMIME-Version: 1.0n" .
				"Content-Type: multipart/mixed;n" .
				" boundary="{$mime_boundary}"";

			  // Add a multipart boundary above the plain message
			$new_message = "This is a multi-part message in MIME format.nn" .
				"--{$mime_boundary}n" .
				"Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset="".$EMAIL_OPTIONS['CHARSET'].""n" .
				"Content-Transfer-Encoding: 7bitnn" .
				$admin_message . "nn";

			  // Add file attachment to the message
			 $new_message .= "--{$mime_boundary}n" .
	             "Content-Type: {$fileatt_type};n" .
	             " name="{$new_filename}"n" .
	             "Content-Disposition: attachment;n" .
	             " filename="{$new_filename}"n" .
	             "Content-Transfer-Encoding: base64nn" .
	             $attachment_data . "nn" .
	             "--{$mime_boundary}--n";

			unset($attachment_data);
		} else {

			//regular headers
			$headers = "Return-Path: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">rn";
			$headers .= "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">rn";
			$headers .= "Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=".$EMAIL_OPTIONS['CHARSET'].";nnrn";
			$new_message = $admin_message;
		}

		//Send admin emails
		foreach($ADMIN_EMAILS as $this_email){
			mail ($this_email,$EMAIL_OPTIONS['ADMIN_SUBJECT'],$new_message,$headers);
		}
	}

//Remove file if not needed
//if($FILE_DO == 2){
// unlink($FILE_UPLOADS_DIR.$new_filename);
// }

	$message = 'Your contact has been sent, thank you.';
	$_POST = NULL;
}

}

if($message != NULL){

?>

<?=$message;?>

<?php } ?>
<tr>
  <td colspan="2">Disclaimer: Please note that The Poverello Center does not guarantee you a donation item pick-up by filling out this form. All pick-up items are required to be in saleable condition and must meet the Poverello Center saleable condition standard. The condition of all items to be donated, size of the donation item(s) and pick-up location are considered before any donation pick-up is scheduled.</td>
  <td colspan="2"><input  type="checkbox" value="Add" name="agreem[]" id="add_info"> Yes, send me addiotional information such as annoucements, special events, and more.</td>
</tr>
<tr>
	<td colspan="2"><div align="center">
	<input type="submit" name="Submit" value="Send Contact">
	<input name="submit_id" type="hidden" id="submit_id" value="1">
	</div></td>
</tr>
Poverello Thrift Store
Thank you for donating to The Poverello Thrift Stores. Please fill out the form below to make an online donation pick-up request, Poverello Thrift Store representative will contact you within the next 48-hour by phone.
Note: Poverello Thrift Stores donation pick-up's are made only within the Fort Lauderdale and Wilton Manor, metropolitan areas. Donation pick-up's are made 5 days a week between 9am and 2pm. Pick-up availability depends on pick-up location and time.
All fields with (*) must be completed.
If you are using anti-spam software, please allow emails from Poverello.org to be received.
Title: <?php if($_POST['ttitle'] == 'Mr' || $_POST['ttitle'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?> >Mr <?php if($_POST['ttitle'] == 'Mrs'){ $sel = ' selected';} else { $sel = NULL;} ?> >Mrs <?php if($_POST['ttitle'] == 'Miss'){ $sel = ' selected';} else { $sel = NULL;} ?> >Miss <?php if($_POST['ttitle'] == 'Ms'){ $sel = ' selected';} else { $sel = NULL;} ?> Ms <?php if($_POST['ttitle'] == 'Dr'){ $sel = ' selected';} else { $sel = NULL;} ?> Dr *
First Name: *
Last Name: *
Address: *
Address:
City: *
State: <?php if($_POST['state'] == 'AL' || $_POST['state'] == NULL){ $sel = ' selected';} else { $sel = NULL;} ?> >AL <?php if($_POST['state'] == 'AK'){ $sel = ' selected';} else { $sel = NULL;} ?> >AK <?php if($_POST['state'] == 'AZ'){ $sel = ' selected';} else { $sel = NULL;} ?> >AZ <?php if($_POST['state'] == 'AR'){ $sel = ' selected';} else { $sel = NULL;} ?> AR <?php if($_POST['state'] == 'CA'){ $sel = ' selected';} else { $sel = NULL;} ?> CA <?php if($_POST['state'] == 'CO'){ $sel = ' selected';} else { $sel = NULL;} ?> CO <?php if($_POST['state'] == 'CT'){ $sel = ' selected';} else { $sel = NULL;} ?> CT <?php if($_POST['state'] == 'DE'){ $sel = ' selected';} else { $sel = NULL;} ?> DE <?php if($_POST['state'] == 'DC'){ $sel = ' selected';} else { $sel = NULL;} ?> DC <?php if($_POST['state'] == 'FL'){ $sel = ' selected';} else { $sel = NULL;} ?> FL <?php if($_POST['state'] == 'GA'){ $sel = ' selected';} else { $sel = NULL;} ?> GA <?php if($_POST['state'] == 'HI'){ $sel = ' selected';} else { $sel = NULL;} ?> HI <?php if($_POST['state'] == 'ID'){ $sel = ' selected';} else { $sel = NULL;} ?> ID <?php if($_POST['state'] == 'IL'){ $sel = ' selected';} else { $sel = NULL;} ?> IL <?php if($_POST['state'] == 'IN'){ $sel = ' selected';} else { $sel = NULL;} ?> IN <?php if($_POST['state'] == 'IA'){ $sel = ' selected';} else { $sel = NULL;} ?> IA <?php if($_POST['state'] == 'KS'){ $sel = ' selected';} else { $sel = NULL;} ?> KS <?php if($_POST['state'] == 'KS'){ $sel = ' selected';} else { $sel = NULL;} ?> KS <?php if($_POST['state'] == 'KY'){ $sel = ' selected';} else { $sel = NULL;} ?> KY <?php if($_POST['state'] == 'LA'){ $sel = ' selected';} else { $sel = NULL;} ?> LA <?php if($_POST['state'] == 'ME'){ $sel = ' selected';} else { $sel = NULL;} ?> ME <?php if($_POST['state'] == 'MD'){ $sel = ' selected';} else { $sel = NULL;} ?> MD <?php if($_POST['state'] == 'MA'){ $sel = ' selected';} else { $sel = NULL;} ?> MA <?php if($_POST['state'] == 'MI'){ $sel = ' selected';} else { $sel = NULL;} ?> MI <?php if($_POST['state'] == 'MN'){ $sel = ' selected';} else { $sel = NULL;} ?> MN <?php if($_POST['state'] == 'MS'){ $sel = ' selected';} else { $sel = NULL;} ?> MS <?php if($_POST['state'] == 'MO'){ $sel = ' selected';} else { $sel = NULL;} ?> MO <?php if($_POST['state'] == 'MT'){ $sel = ' selected';} else { $sel = NULL;} ?> MT <?php if($_POST['state'] == 'NC'){ $sel = ' selected';} else { $sel = NULL;} ?> NC <?php if($_POST['state'] == 'ND'){ $sel = ' selected';} else { $sel = NULL;} ?> ND <?php if($_POST['state'] == 'NE'){ $sel = ' selected';} else { $sel = NULL;} ?> NE <?php if($_POST['state'] == 'NH'){ $sel = ' selected';} else { $sel = NULL;} ?> NH <?php if($_POST['state'] == 'NJ'){ $sel = ' selected';} else { $sel = NULL;} ?> NJ <?php if($_POST['state'] == 'NM'){ $sel = ' selected';} else { $sel = NULL;} ?> NM <?php if($_POST['state'] == 'NV'){ $sel = ' selected';} else { $sel = NULL;} ?> NV <?php if($_POST['state'] == 'NY'){ $sel = ' selected';} else { $sel = NULL;} ?> NY <?php if($_POST['state'] == 'OH'){ $sel = ' selected';} else { $sel = NULL;} ?> OH <?php if($_POST['state'] == 'OK'){ $sel = ' selected';} else { $sel = NULL;} ?> OK <?php if($_POST['state'] == 'OR'){ $sel = ' selected';} else { $sel = NULL;} ?> OR <?php if($_POST['state'] == 'PA'){ $sel = ' selected';} else { $sel = NULL;} ?> PA <?php if($_POST['state'] == 'RI'){ $sel = ' selected';} else { $sel = NULL;} ?> RI <?php if($_POST['state'] == 'SC'){ $sel = ' selected';} else { $sel = NULL;} ?> SC <?php if($_POST['state'] == 'SD'){ $sel = ' selected';} else { $sel = NULL;} ?> SD <?php if($_POST['state'] == 'TN'){ $sel = ' selected';} else { $sel = NULL;} ?> TN <?php if($_POST['state'] == 'TX'){ $sel = ' selected';} else { $sel = NULL;} ?> TX <?php if($_POST['state'] == 'UT'){ $sel = ' selected';} else { $sel = NULL;} ?> UT <?php if($_POST['state'] == 'VT'){ $sel = ' selected';} else { $sel = NULL;} ?> VT <?php if($_POST['state'] == 'VA'){ $sel = ' selected';} else { $sel = NULL;} ?> VA <?php if($_POST['state'] == 'WA'){ $sel = ' selected';} else { $sel = NULL;} ?> WA <?php if($_POST['state'] == 'WV'){ $sel = ' selected';} else { $sel = NULL;} ?> WV <?php if($_POST['state'] == 'WI'){ $sel = ' selected';} else { $sel = NULL;} ?> WI <?php if($_POST['state'] == 'WY'){ $sel = ' selected';} else { $sel = NULL;} ?> WY *
Zip Code: *
Home Phone: *
Business Phone: (optional)
Email: *
List Description of items to pick-up: <?php echo $_POST['message_text'];?> *
How did you hear about the Poverello website? Search engine (Google, yahoo, etc.)
Poverello Thrift Store
A Friend
Other:
I have read and agree to the above Disclaimer terms
<?php ?>[/code]

checkboxes that are not checked are not submitted with the form at all.

u collect them inside an array: agreem[]=Agreement&agreem[]=Add

print_r($_POST[‘agreem’]) would output something like:
Array(
[0] => Agreement
[1] => Add
)
but echo($_POST[‘agreem’]) will output: “Array”
and $_POST[‘add_info’] is never set.

<input type="checkbox" name="agreem" value="I have read and agree to the above Disclaimer terms" id="agreem"> I have read and agree to the above Disclaimer terms <input type="checkbox" name="add_info" value="Yes, send me addiotional information such as annoucements, special events, and more." id="add_info"> Yes, send me addiotional information such as annoucements, special events, and more.
hope this helps

Q1712,
thk you for your reply. I worked fine.

I hv 1 more question. How do I get the radio buttons to work on show up on my email. I believe the code specified is incorrect above for the radio button. I hv another that they above inputs to, then sends to my email the variable name somthing like $namehere$ (this would be the id).
can you help pls.

tks

Sponsor our Newsletter | Privacy Policy | Terms of Service