I have a form that outputs data to a mail but the checkboxes output nothing.This is my php code. Any help please

<html>
	<head>
		<title>Palm Safaris and Logistics:Bookings</title>
		<meta http-equiv="refresh" content="2; URL=http://www.palmsafaris.com/booking/bookings.shtml">
		<meta name="keywords" content="automatic redirection">
				
	</head>
		<body>
		
			<?php
			/*$game_viewing='unchecked';
			$gorilla_trekking='unchecked';			$chimp_trekking='unchecked';
			$hiking='unchecked';					$mt_climb ='unchecked';		
			$water_rafting='unchecked';				$Cultural_tour='unchecked';
			$murchison_falls_NP='unchecked';		$QE_NP='unchecked';
			$bwindi_forest='unchecked';				$mgahinga_NP='unchecked';
			$kibale_forest='unchecked';				$semilki_reserve ='unchecked';
			$kidepo_valley='unchecked';				$lake_mburo ='unchecked';
			
			if (isset($_POST['submitButtonName'])){
			
			if (isset($_POST['game_viewing'])) {
				$game_viewing = $_POST['game_viewing'];

			if ($game_viewing = = 'Game Viewing') {
			$game_viewing = 'checked';
			 print $game_viewing ;
				}
			}*/
	
				$r_Name = $_POST['r_Name'];						$Age = $_POST['agebra']; 	
				$schTour = $_POST['sec2_join_existing_tour'];	$Street  = $_POST['Street'];	
				$City = $_POST['City'];							$State   = $_POST['State'];																					
				$ctry	 = $_POST['Country'];					$Post = $_POST['Post'];
				$phadd = $_POST['phyadd'];						$Ofph = $_POST["Ofph"];
				$Mobph   = $_POST['Mobph'];						$Fax  = $_POST['Fax'];
				$PpleTra = $_POST['PpleTra'];					$Acco = $_POST['Acco'];
				$date1	 = $_POST['sec2_date1'];				$date2 = $_POST['sec2_date2'];
				$date3	 = $_POST['sec2_date3'];				$sec1 = $_POST['sec2_no_days'];
				$sec2	 = $_POST['sec2_join_existing_tour'];	$Ref  = $_POST['Ref_web'];
				$spe	 = $_POST['spe_needs'];					$gview = $_POST['game_viewing'];
				$bd		 = $_POST['ornithology'];				$goTrek = $_POST['gorilla_trekking'];
				$chimp	 = $_POST['chimp_trekking'];			$hik	= $_POST['hiking'];
				$mt 	 = $_POST['mt_climb'];					$water	= $_POST['water_rafting'];
				$tr	     = $_POST['Cultural_tour'];				$oth	= $_POST['others'];
				$murch	 = $_POST['murchison_falls_NP'];		$qn		= $_POST['QE_NP'];
				$imp 	 = $_POST['bwindi_forest'];				$gahi	= $_POST['mgahinga_NP'];
				$kib	 = $_POST['kibale_forest'];				$sem	= $_POST['semilki_reserve'];
				$kid	 = $_POST['kidepo_valley'];				$mburo  = $_POST['lake_mburo'];
				$othe	 = $_POST['otherinterest'];				$Email   = $_POST['re_eMail'];	
					
				if($r_Name=='' || $phadd=='' || $Age=='' || $ctry=='' || $Email=='') //check for the required fields 
				{
					print"<center><font style='font-family:verdana; font-size:12px;'><b>Empty fields detected: fill all fields marked *, <br /><br /> <a href='bookings.shtml'> Please try again.</a></b></font></center>";
				//}
					
				//elseif(eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}(\.[a-zA-Z]{2,3})?(\.[a-zA-Z]{2,3})?$', $Email))
				//{
 //  print"<center><font style='font-family:verdana; font-size:12px;'><b>Wrong Email Address, <br /><br /> <a href='bookings.shtml'> Please try again.</a></b></font></center>";
		//		
		//if (!isset($_POST['submit']))
				}
				else
				{
					$date = date("j M, Y");			//e.g. 10 Mar, 2001
					$time = date("g:i:s a");		//e.g. 5:16:23 pm
					$timeSENT = $date." - ".$time;	//e.g. 10 Mar, 2001 - 5:16:23pm
		
					$message = " Traveller's Name: $r_Name\nAge Bracket: $Age\nScheduled Tour: $sec2_join_existing_tour\nStreet: $phadd\nCity: $City\nState: $State\nCountry: $ctry\n Postal Code: $Post Office\nPhone: $Ofph\n Mobile Phone: $Mobph\nFax: $Fax\nEmail: $Email\nHow Many Peeople wish to Travel: $PpleTra\nType of accomodation: $Acco\nDate would you like to begin: $sec2_date1 $sec2_date2 $sec2_date3\nNumberof days  to spend on your trip: $sec2_no_days\nWould you like to join scheduled tour?: $sec2_join_existing_tour\nHow did you find us: $Ref_web\nSpecial needs: $spe_needs\nInterests: $game_viewing $bird $gorilla_trekking $chimp_trekking $hiking $mt_climb $water_rafting $Cultural_tour $others $murchison_falls_NP $QE_NP $bwindi_forest $mgahinga_NP $kibale_forest " ; 
								
					$sender = $Email;
					$to = "h.rwandekeye@gmail.com";	//palm@palmsafaris.com
					$subject = "Palm Safaris Booking Information";
					$body = $message;
					$from = $sender;
					$headers = "From: $from";
		
					mail($to,$subject,$body,$headers) or die(mysql_error());
		
					print "<center><font face='verdana' size='2'><Thank you for submitting our form. We will get back to you as soon as possible></center></font>";
				}
			 ?>
 
 	</body>
 
 </html>

So, the redirect at the top proved useful once I realised what was going on! I am assuming that the redirect destination page is the form?

There are no values in the checkbox input fields. If you include value="gorilla" (or whatever) in the form input field then that is the value that you will get if it is checked. If it is not checked you won't get any value.

hope this helps ...
Simon.

Edit ... hang on ... I've looked again ... values are there now! Was I mistaken or did you just figure it out? :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.