Hi.......all......

here i will give whole of my code just go through the code and give me the solution
i have 3 pages........in the first page collecting the user information and storing in a session
and in the second page just selecting the main option and in the third page selecting particular options clicking on the checkboxes and storing those values in a session......in this page we have register button......so after clicking it has to store in a database........please suggest me what should i do.............first part is working fine......but the second part that is selection is giving problem.....................


first page

<? 
// session_start();
//	if($_SERVER['REQUEST_METHOD']=='POST')

 include("header.php") ?>	 

<html>
<body>
<table width="960" border="0" cellpadding="0" cellspacing="0" align="center">
	     <tr>
		       <td width="100%"><? include("top_banner.php") ?></td>			     
	     </tr>
	     <tr>
		      <td align="center" height="48" width="100%"><? include("horizental_menu.php") ?></td>
	     </tr>

	<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0" class="whitesite" >
		<!-- header -->
		<tr><td>		
	<table cellpadding="0" cellspacing="0" width="100%" border="0">
		<tr><td background="images/button_bot.jpg" width="100%" height="5" colspan="3"></td></tr>
	</table>
</td></tr>

		<!-- content -->
		<tr><td width="100%">
			<table cellpadding="0" cellspacing="0" width="100%" border="0">
				<tr>

<td width="5">&nbsp;</td>
<td width="207" valign="top" class="" align="center">
	<table cellpadding="0" cellspacing="0" width="207" border="0" align="center">
				<tr><td height="5"></td></tr>
		
		
		<tr><td align="center"  width="207">
			<table cellpadding="1" cellspacing="1" width="195" align="center" border="0">
		</table>
		</td></tr>
		
		<tr><td height="5"></td></tr>
		<tr><td height="5"></td></tr>
				<tr><td height="5"></td></tr>
	</table>
</td>
<td width="5">&nbsp;</td>
					<!--  -->
					<td valign="top">
						<table cellpadding="0" cellspacing="0" width="100%" border="0">
							<tr><td height="5"></td></tr>
							<tr>
								<td width="100%">
									<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
											<tr>
	<td><img src="images/box_left.gif" width="10" height="31" alt=""></td>
	<td nowrap  background="images/box_topbg.gif" width="100%" height="31">
		<table cellpadding="0" cellspacing="0" width="100%" border="0">
			<tr>
				
				<td style="padding-left:5px;" class="headtitle">
											Service Provider Registration
															</td>
			</tr>
		 </table>
	<td><img src="images/box_right.gif" width="10" height="31" alt=""></td>
</tr>
<tr>
	<td background="images/box_leftbg.gif" width="10"></td>
	<td bgcolor="#FFFFFF">
											<table cellpadding="0" cellspacing="0" width="100%">
												
																								
												<tr><td height="30">Register now to bid on <b>eGlazers</b> site. It's easy and <b>free</b>. Already registered? <span style="color:#005D95"><strong>Sign in now</strong></span>.</td></tr>
												<tr><td align="right" colspan="3" style="color:red">[ <span class="error_text">*</span> ] <span class="mandi">indicates required fields</span></td></tr>
												<tr><td height="15"></td></tr>
												<form name='form2' method='post' action="contractor_services.php" onsubmit="return val_cont(this);" > 
												<!-- <form name='form1' method='post' action="">-->
													<tr><td>
														<table border="0" cellpadding="1" cellspacing="5" align="center" width="100%" style="border:1px solid #EDEDED;background-color:#f6f6f6">
															<tr>
																<td width="35%">Email ID</td>
																
																<td width="3%"><strong>:</strong></td>
																
																<td><input type='text' name='emailid' id="emailid" class="text" size='30' value="" maxlength='50' />&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span></td>
															</tr>
															<tr>
																<td>Password</td>
																<td><strong>:</strong></td>
																<td><input type="Password" name="password" id="password" maxlength="20" class="text"  />&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span></td>
															</tr>
															<tr>
																<td>Confirm Password</td>
																<td><strong>:</strong></td>
																<td><input type="Password" name="conpass" id="conpass"  maxlength="20" class="text" />&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span></td>
															</tr>
	
															


															<tr>
																<td>Business  Name</td>
																<td><strong>:</strong></td>
																<td><input type="Text" name="businessname"
																id="businessname" maxlength="30" value="" class="text" " >&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span></td>
															</tr>
															<tr>
																<td>Street Address</td>
																<td><strong>:</strong></td>
																<td><input type="Text" name="streetaddress" class="text" value="" id="streetaddress" />&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span></td>
															</tr>
															<tr>
																<td>Zip Code</td>
																<td><strong>:</strong></td>
																<td><input type='text' name="zip" value="" class="text" maxlength='5' id="zip" >&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span></td>
															</tr>
															<tr>
																<td valign="top">Phone</td>
																<td valign="top"><strong>:</strong></td>
																<td><input type='text' class="num" value="" name="phoneareacode" id="phoneareacode" size='5' maxlength='3'> - <input type='text' class="num" name="phoneprefix" value="" size="5" maxlength='3' id="phoneprefix" > - <input type='text' name="phonesuffix" value="" class="num" size='5' maxlength='4'
																id="phonesuffix"
																>&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span>&nbsp;<font color="#808080" style="font-size:11px;">(Eg., 213 - 555 - 1212)</font></td>
															</tr>
															<tr>
																<td valign="top">Fax</td>
																<td valign="top"><strong>:</strong></td>
																<td><input type='text' class="num" name="faxareacode" 	id="faxareacode" value="" size='5' maxlength='3' > - <input type='text' class="num" name="faxprefix" 	id="faxprefix" value="" size='5' maxlength='3' > - <input type='text' name="faxsuffix"	id="faxsuffix"
																value="" class="num" size='5' maxlength='4' >&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span>&nbsp;<font color="#808080"  style="font-size:11px;">(Eg., 213 - 555 - 1212)</font></td>
															</tr>
															<tr>
																<td>Contractor First name</td>
																<td><strong>:</strong></td>
																<td><input type='text' name="contactfirstname"
																id="contactfirstname"
																value="" class="text" size='30' maxlength='20' >&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span></td>
															</tr>
															<tr>
																<td>Contractor Last name</td>
																<td><strong>:</strong></td>
																<td><input type='text' name="contactlastname"
																id="contactlastname"
																value="" class="text" size='30' maxlength='20' >&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span></td>
															</tr>
															<tr>
																<td valign="top">Comments</td>
																<td valign="top"><strong>:</strong></td>
																<td><textarea name="comments" id="comments" rows="7" cols="60" class="textarea"></textarea></td>
															</tr>

															<tr ><td  colspan="2"></td><td><input  type='submit'  class="button1" name="reg" value="Next"></td></tr>

															<tr><td colspan="3"> <input type="checkbox" name="rules"
															>I accept the terms and conditions </td></tr>
															<tr><td  align="right" colspan="" style="color:red"><a href="lll.html"><span class="mandi"><b>rules</b></span></td></tr>
														</table>
													</td></tr>
												</form>
											</table>
											</td>
	<td background="images/box_rightbg.gif" width="10"></td>
</tr>
<tr>
	<td><img src="images/box_botleft.gif" width="10" height="10" alt=""></td>
	<td background="images/box_botbg.gif" width="100%" height="10" alt=""></td>
	<td><img src="images/box_botright.gif" width="10" height="10" alt=""></td>
</tr>

									</table>
								</td>
							</tr>
						</table>
					</td>
					<!-- right nav -->
					<td width="5">&nbsp;</td>
<td width="207" class="borleftright" valign="top" align="center">
	<table cellpadding="0" cellspacing="0" width="207" align="center"> 
				<tr><td height="5"></td></tr>
		
		
			<tr><td align="center"  width="207">
				<table cellpadding="1" cellspacing="1" width="195" align="center" border="0">
					<td></tr>
					
					
					<tr><td height="5"></td></tr>
					
				</table>
			</td></tr>
			
				</table>
</td>
<td width="5">&nbsp;</td>
				</tr>
			</table>
		</td></tr>	
		<!-- footer -->
	
		
		<tr><td background="images/button_bot.jpg" height="7" width="100%"></td></tr>
		
		<tr>
		
		<!--    <td ><div align="center"><img src="images/vertical_line.jpg" alt="auto repair service list mechanic garage dark green line" width="940" height="8" /></div> -->
			<? include("footer.php") ?></td>
	    </tr>
      </table>
    </body>
</html>

second page:

<? 
session_start();
	if($_SERVER['REQUEST_METHOD']=='POST')
	{
	$emailid=$_POST['emailid'];
		$password=$_POST['password'];
		$conpass=$_POST['conpass'];
		$businessname=$_POST['businessname'];
		$streetaddress=$_POST['streetaddress'];
		$zip=$_POST['zip'];
		$phoneareacode=$_POST['phoneareacode'];
		$phoneprefix=$_POST['phoneprefix'];
		$phonesuffix=$_POST['phonesuffix'];
		$faxareacode=$_POST['faxareacode'];
		$faxprefix=$_POST['faxprefix'];
		$faxsuffix=$_POST['faxsuffix'];
		$contactfirstname=$_POST['contactfirstname'];
		$contactlastname=$_POST['contactlastname'];
		$comments=$_POST['comments'];
		session_register("emailid");
		session_register("password");
		session_register("conpass");
		session_register("businessname");
		session_register("streetaddress");
		session_register("zip");
		session_register("phoneareacode");
		session_register("phoneprefix");
		session_register("phonesuffix");
		session_register("faxareacode");
		session_register("faxprefix");
		session_register("faxsuffix");
		session_register("contactfirstname");
		session_register("contactlastname");
		session_register("comments");
	}
include("header.php") ?>	 

<html>
<body>
<table width="960" border="0" cellpadding="0" cellspacing="0" align="center">
	     <tr>
		       <td width="100%"><? include("top_banner.php") ?></td>			     
	     </tr>
	     <tr>
		      <td align="center" height="48" width="100%"><? include("horizental_menu.php") ?></td>
	     </tr>

	<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0" class="whitesite" >
		<!-- header -->
		<tr><td>		
	<table cellpadding="0" cellspacing="0" width="100%" border="0">
		<tr><td background="images/button_bot.jpg" width="100%" height="5" colspan="3"></td></tr>
	</table>
</td></tr>

		<!-- content -->
		<tr><td width="100%">
			<table cellpadding="0" cellspacing="0" width="100%" border="0">
				<tr>

<td width="5">&nbsp;</td>
<td width="207" valign="top" class="" align="center">
	<table cellpadding="0" cellspacing="0" width="207" border="0" align="center">
				<tr><td height="5"></td></tr>
		
		
		<tr><td align="center"  width="207">
			<table cellpadding="1" cellspacing="1" width="195" align="center" border="0">
		</table>
		</td></tr>
		
		<tr><td height="5"></td></tr>
		<tr><td height="5"></td></tr>
				<tr><td height="5"></td></tr>
	</table>
</td>
<td width="5">&nbsp;</td>
					<!--  -->
					<td valign="top">
						<table cellpadding="0" cellspacing="0" width="100%" border="0">
							<tr><td height="5"></td></tr>
							<tr>
								<td width="100%">
									<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
											<tr>
	<td><img src="images/box_left.gif" width="10" height="31" alt=""></td>
	<td nowrap  background="images/box_topbg.gif" width="100%" height="31">
	<table cellpadding="0" cellspacing="0" width="100%" border="0">
			<tr>
				
				<td style="padding-left:5px;" class="headtitle">
											Service Provider 
															</td>
			</tr>
		 </table>
<td><img src="images/box_right.gif" width="10" height="31" alt=""></td>
</tr>
<tr>
	<td background="images/box_leftbg.gif" width="10"></td>
	<td bgcolor="#FFFFFF">
											<table cellpadding="0" cellspacing="0" width="100%">
												
																								
												<tr><td height="30">Register now to bid on <b>eGlazers</b> site. It's easy and <b>free</b>. Already registered? <span style="color:#005D95"><strong>Sign in now</strong></span>.</td></tr>
												<tr><td align="right" colspan="3" style="color:red">[ <span class="error_text">*</span> ] <span class="mandi">indicates required fields</span></td></tr>
												<tr><td height="15"></td></tr>
												<form name='form2' method='post' action="contractor_selection_service.php" onsubmit="return val_cont(this);" > 
												<!-- <form name='form1' method='post' action="">-->
													<tr><td>
														<table border="0" cellpadding="1" cellspacing="5" align="center" width="100%" style="border:1px solid #EDEDED;background-color:#f6f6f6">
															<tr>
																<td width="35%">Request a Quote</td>
																
																<td width="3%"><strong>:</strong></td>
																
																
															</tr>
															
															
															<tr>
																<td> <select name="category" id="category">
										<option selected="selected">service_category</option>
										<option>servicetype</option>
										<option>services</option>
										<option>others</option>
										 </select>
											 </td>
					  
											</tr>
															
															


															<tr ><td  colspan="2"></td><td><input  type='submit'  class="button1" name="reg" value="Select"></td></tr>
														</table>
													</td></tr>
												</form>
											</table>
											</td>
	<td background="images/box_rightbg.gif" width="10"></td>
</tr>
<tr>
	<td><img src="images/box_botleft.gif" width="10" height="10" alt=""></td>
	<td background="images/box_botbg.gif" width="100%" height="10" alt=""></td>
	<td><img src="images/box_botright.gif" width="10" height="10" alt=""></td>
</tr>

									</table>
								</td>
							</tr>
						</table>
					</td>
					<!-- right nav -->
					<td width="5">&nbsp;</td>
<td width="207" class="borleftright" valign="top" align="center">
	<table cellpadding="0" cellspacing="0" width="207" align="center"> 
				<tr><td height="5"></td></tr>
		
		
			<tr><td align="center"  width="207">
				<table cellpadding="1" cellspacing="1" width="195" align="center" border="0">
					<td></tr>
					
					
					<tr><td height="5"></td></tr>
					
				</table>
			</td></tr>
			
				</table>
</td>
<td width="5">&nbsp;</td>
				</tr>
			</table>
		</td></tr>	
		<!-- footer -->
	
		<tr><td background="images/button_bot.jpg" height="7" width="100%"></td></tr>
		
		
			<tr>
		
		
		<!--    <td ><div align="center"><img src="images/vertical_line.jpg" alt="auto repair service list mechanic garage dark green line" width="940" height="8" /></div> -->
			<? include("footer.php") ?></td>
	    </tr>
      </table>
    </body>
</html>

Third page:

<? 
 session_start();
				

			
				$otherservices=$_POST['otherservices'];
				session_register('a1');
				session_register('b1');
				session_register('c1');	
				session_register('otherservices');	
		
   echo $_SESSION['emailid'];   
 include("header.php") ?>	 
<html>
<head><title>auto alto</title>
<script>
function comparision(){
d=document.form2;
var total="";
if(!d.contype.length){
if(d.contype.checked) {
d.check_compare.value=d.check_compare.value+d.contype.value+',';
return true;
} else {
alert("Please select check Box");
return false;
}
}
for(var i=0; i < d.contype.length; i++){
if(d.contype[i].checked) {
total +=d.contype[i].value + "\n";
d.check_compare.value=d.check_compare.value+d.contype[i].value+',';
}
}
if(d.check_compare.value=="") {
alert("Please select atleast one check Box");
return false;
}
}
</script>
</head>
<body>

<table width="960" border="0" cellpadding="0" cellspacing="0" align="center">
 <tr>
 <td width="100%"><? include("top_banner.php") ?></td>			     
</tr>
 <tr>
 <td align="center" height="48" width="100%"><? include("horizental_menu.php") ?></td>
 </tr>

<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0" class="whitesite" >
		<!-- header -->
<tr><td>		
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr><td background="images/button_bot.jpg" width="100%" height="5" colspan="3"></td></tr>
</table>
</td></tr>
	<!-- content -->
<tr><td width="100%">
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>

<td width="5">&nbsp;</td>
<td width="207" valign="top" class="" align="center">
<table cellpadding="0" cellspacing="0" width="207" border="0" align="center">
<tr><td height="5"></td></tr>
		
		
<tr><td align="center"  width="207">
<table cellpadding="1" cellspacing="1" width="195" align="center" border="0">
</table>
</td></tr>
		
<tr><td height="5"></td></tr>
<tr><td height="5"></td></tr>
<tr><td height="5"></td></tr>
</table>
</td>
<td width="5">&nbsp;</td>
	
<td valign="top">
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr><td height="5"></td></tr>
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tr>
<td><img src="images/box_left.gif" width="10" height="31" alt=""></td>
<td nowrap  background="images/box_topbg.gif" width="100%" height="31">
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
			
	<td style="padding-left:5px;" class="headtitle">Service Provider </td>
</tr>
</table>
<td><img src="images/box_right.gif" width="10" height="31" alt=""></td>
</tr>
<tr>
	<td background="images/box_leftbg.gif" width="10"></td>
	<td bgcolor="#FFFFFF">
											<table cellpadding="0" cellspacing="0" width="100%">
												
																								
												<tr><td height="30">Register now to bid on <b>eGlazers</b> site. It's easy and <b>free</b>. Already registered? <span style="color:005D95"><strong>Sign in now</strong></span>.</td></tr>
												<tr><td align="right" colspan="3" style="color:red">[ <span class="error_text">*</span> ] <span class="mandi">indicates required fields</span></td></tr>
												<tr><td height="15"></td></tr>
												<form name='form2' method='post' action="contractor.php" onsubmit="return comparision(this);" > 
												<!-- <form name='form1' method='post' action="">-->
													<tr><td>
														<table border="0" cellpadding="1" cellspacing="5" align="center" width="100%" style="border:1px solid #EDEDED;background-color:#f6f6f6">
															
												<tr><td>				



<?php

	include('database.php');


 $stype=$_POST['category'];
if($stype=="service_category")
   { 
	 
	 $result = mysql_query("SELECT * FROM  service_category ");
	while($row = mysql_fetch_array($result))
		{
		?><input type="Checkbox" name="a[]" id="a[]"  value="servicec"><?echo $row['servicec'];
		echo "<br />";
		$a[i]=$row['servicec'];
		$i++;
		//$_SESSION['a1']=$a[i];
			//	echo  $_SESSION['a1'];

		}
		$_SESSION['a1']=$a;

   }
  
  else if($stype=="servicetype")
		 { 
	 
		$result = mysql_query("SELECT * FROM  service_type ");
		while($row = mysql_fetch_array($result))
				{
				?><input type="Checkbox" name="b[]" id="b[]"  value="servicet"> <?echo $row['servicet'];
				echo "<br />";
				$b[i]=$row['servicet'];
				$i++;
			    //$_SESSION['b1']=$b[i];
				//echo  $_SESSION['b1'];
				}
				$_SESSION['b1']=$b;

	 }
else if($stype=="services")
		{	
			$result = mysql_query("SELECT * FROM  services ");
			while($row = mysql_fetch_array($result))
			{
				?><input type="Checkbox" name="c[]" id="c[]"  value="servicess"> <?echo $row['servicess'];
				echo "<br />";
				$c[i]=$row['servicess'];
				$i++;
				//$_SESSION['c1']=$c[i];
				//echo  $_SESSION['c1'];
			}
			$_SESSION['c1']=$c;
		 }
else
{
	?>
	other services<input type="Text" name="otherservices" 																id="otherservices" maxlength="30" value="" class="text" " >&nbsp;<span class="error_text" style="vertical-align:top;color:red">*</span>
	<?
}
mysql_close();

?>

</td>
</tr>
<tr >
<td colspan="2"></td>
<td><input  type='submit'  class="button1" name="reg" value="Register"></td></tr> 

	
	</table>
   </td></tr>
	</form>
	</table>
	</td>
	<td background="images/box_rightbg.gif" width="10"></td>
  </tr>
  <tr>
	<td><img src="images/box_botleft.gif" width="10" height="10" alt=""></td>
	<td background="images/box_botbg.gif" width="100%" height="10" alt=""></td>
	<td><img src="images/box_botright.gif" width="10" height="10" alt=""></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<!-- right nav -->
<td width="5">&nbsp;</td>
<td width="207" class="borleftright" valign="top" align="center">
<table cellpadding="0" cellspacing="0" width="207" align="center"> 
<tr><td height="5"></td></tr>
<tr><td align="center"  width="207">
<table cellpadding="1" cellspacing="1" width="195" align="center" border="0">
<td></tr>
<tr><td height="5"></td></tr>
</table>
</td></tr>
</table>
</td>
<td width="5">&nbsp;</td>
</tr>
</table>
</td></tr>	
		<!-- footer -->
		
		
		
		<tr><td background="images/button_bot.jpg" height="7" width="100%"></td></tr>
		<tr>

		<!--    <td ><div align="center"><img src="images/vertical_line.jpg" alt="auto repair service list mechanic garage dark green line" width="940" height="8" /></div> -->
			<? include("footer.php") ?></td>
	    </tr>
      </table>
    </body>
</html>

Fourth Page:

<? 
session_start();
$emailid = $_SESSION['emailid'];
$password= $_SESSION['password'];
$conpass=$_SESSION['conpass'];
$businessname=$_SESSION['businessname'];
$streetaddress=$_SESSION['streetaddress'];
$zip=$_SESSION['zip'];
$phoneareacode=$_SESSION['phoneareacode'];
$phoneprefix=$_SESSION['phoneprefix'];
$phonesuffix=$_SESSION['phonesuffix'];
$faxareacode=$_SESSION['faxareacode'];
$faxprefix=$_SESSION['faxprefix'];
$faxsuffix=$_SESSION['faxsuffix'];
$contactfirstname=$_SESSION['contactfirstname'];
$contactlastname=$_SESSION['contactlastname'];
$comments=$_SESSION['comments'];
//$a[]=$_SESSION['a1'];
//$b[]=$_SESSION['b1'];
//$c[]=$_SESSION['c1'];
$otherservices=$_SESSION['otherservices'];
echo $_SESSION['emailid'];
//echo  $_SESSION['c1'];

//echo  $_SESSION['b1'];
echo $_SESSION['businessname'];
echo $_SESSION['streetaddress'];
//echo $_SESSION['a[]'];
//echo $_SESSION['b[]'];
$a = $_SESSION['a1']; //assign $_SESSION['array'] to $array
foreach($a as $i) {
echo $i; //print $array contents
}
include("header.php") 
?>	 

<table width="960" border="0" cellpadding="0" cellspacing="0" align="center">
 <tr>
	   <td width="100%"><? include("top_banner.php") ?></td>			     
 </tr>
 <tr>
		<td align="center" height="48" width="100%"><? include("horizental_menu.php") ?></td>
 </tr>

<table align="center" cellpadding="0" cellspacing="0" width="100%" border="0" class="whitesite" >
						<!-- header -->
<tr><td>		
	<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr><td background="images/button_bot.jpg" width="100%" height="5" colspan="3"></td></tr>
</table>
</td></tr>

						<!-- content -->
<tr><td width="100%">
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<td width="5">&nbsp;</td>
<td width="207" valign="top" class="" align="center">
<table cellpadding="0" cellspacing="0" width="207" border="0" align="center">
<tr><td height="5"></td></tr>
<tr><td align="center"  width="207">
<table cellpadding="1" cellspacing="1" width="195" align="center" border="0">
</table>
</td></tr>
<tr><td height="5"></td></tr>
<tr><td height="5"></td></tr>
<tr><td height="5"></td></tr>
</table>
</td>
<td width="5">&nbsp;</td>
					<!--  -->
<td valign="top">
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr><td height="5"></td></tr>
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center">
<tr>
<td><img src="images/box_left.gif" width="10" height="31" alt=""></td>
<td nowrap  background="images/box_topbg.gif" width="100%" height="31">
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<td style="padding-left:5px;" class="headtitle">Service Provider Registration</td>
</tr>
 </table>
<td><img src="images/box_right.gif" width="10" height="31" alt=""></td>
</tr>
<tr>
<td background="images/box_leftbg.gif" width="10"></td>
<td bgcolor="#FFFFFF">


<?php 	
	include 'database.php';

$email = $_POST['emailid'];
$pass = addslashes($_POST['password']) ;			
$cpass = addslashes($_POST['conpass']) ;		
$bsname = addslashes($_POST['businessname']) ;			
$streetadd = addslashes($_POST['streetaddress']) ;
$zipcode = addslashes($_POST['zip']) ;		
$tphone1 = $_POST['phoneareacode'];
$tphone2 =  $_POST['phoneprefix'];
$tphone3=$_POST['phonesuffix'] ;	
$fax1 = $_POST['faxareacode'];
$fax2 =  $_POST['faxprefix'];
$fax3=$_POST['faxsuffix'] ;	
$contactfn = $_POST['contactfirstname'];
$contactln =  $_POST['contactlastname'];
$comment=$_POST['comments'] ;	
//$servicec  = implode(",",$_POST['a']);
//$servicet  = implode(",",$_POST['b']);
//$services  = implode(",",$_POST['c']);
//$servicec  = $_POST['a'];
//$servicet  = $_POST['b'];
//$services  = $_POST['c'];
$servicec = addslashes(serialize($a)); 
$servicet = addslashes(serialize($b)); 
$services = addslashes(serialize($c)); 
$others=$_POST['otherservices'];			 

  
/*
@ $db = mysql_connect("localhost", "root", "");	  
if (!$db)	  
{		 $string = $string = implode(",",$_POST['checkboxarray']); 
echo "Error: Could not connect to database.  Please try again later.";		 exit;	  
}	
  
mysql_select_db("autoalto");						
*/

$query1 = "insert into autoalto_contractor(emailId , password, confirmpassword, businessName,streetAddress, zipcode, tephone1, tephone2, tephone3, fax1, fax2,fax3, contractorsFirstname, contractorsLastname, comments,service_category,service_type,services,other_service) values ('".$email."', '".$pass."', '".$cpass."','".$bsname."', '".$streetadd."', '".$zipcode."','".$tphone1."', '".$tphone2."','".$tphone3."', '".$fax1."', '".$fax2."', '".$fax3."','".$contactfn."','".$contactln."','".$comment."','".$servicec."',
'".$servicet."','".$services."','".$others."')";
$result = mysql_query($query1);

$User="";  
	
$check  = "select * from autoalto_contractor where emailId='email'";

if(!$check)	
{
	
die('Could not connect: ' . mysql_error());
}

$rcheck = mysql_query($check) or die(mysql_error());
	
$num    = mysql_num_rows($rcheck);
	
$rcheck = mysql_fetch_array($rcheck);
	
if($num == 0)  // if user not found	
{				
$result = mysql_query($query1);		
echo $User = " Contractor Successfully Created.";	


}
else	
{	 

mysql_close();			
echo $User = " Email id already exist.";						
}			
if (!$result)		
 // header("location:test.php"); // Re-direct to index.php		//header("location: //index.html"); // Re-direct to main.php	 
 ?>
 <?php
session_destroy();
?>

<!--	<p>Thank you for Signing up at eGlazers.</p>

 <p>We will send you an email after approval of your account. 
   The email should arrive you shortly. After that you can log in to eGlazers and bid for eGlazers orders.</p>

<p>Thank you once again for signing up at eGlazers.
</p>	-->
<td background="images/box_rightbg.gif" width="10"></td>
</tr> 
<tr>
	<td><img src="images/box_botleft.gif" width="10" height="10" alt=""></td>
	<td background="images/box_botbg.gif" width="100%" height="10" alt=""></td>
	<td><img src="images/box_botright.gif" width="10" height="10" alt=""></td>
</tr>

									</table>
								</td>
							</tr>
						</table>
					</td>
					<!-- right nav -->
					<td width="5">&nbsp;</td>
<td width="207" class="borleftright" valign="top" align="center">
	<table cellpadding="0" cellspacing="0" width="207" align="center"> 
				<tr><td height="5"></td></tr>
					<tr><td align="center"  width="207">
						<table cellpadding="1" cellspacing="1" width="195" align="center" border="0">
							<td></tr>


								<tr><td height="5"></td></tr>
							</table>
						</td></tr>
					</table>
				</td>
<td width="5">&nbsp;</td>
				</tr>
			</table>
		</td></tr>	
				<tr><td>&nbsp;</td></tr>
				<tr><td>&nbsp;</td></tr>
				<tr><td>&nbsp;</td></tr>
				<tr><td>&nbsp;</td></tr>
				<tr><td>&nbsp;</td></tr>
				<tr><td>&nbsp;</td></tr>
				<tr><td>&nbsp;</td></tr>
				
				<!-- footer -->

<tr><td background="images/button_bot.jpg" height="7" width="100%"></td></tr>
<tr>

					<!--    <td ><div align="center"><img src="images/vertical_line.jpg" alt="auto repair service list mechanic garage dark green line" width="940" height="8" /></div> -->
			<td><? include("footer.php") ?></td>
	    </tr>
      </table>
    </body>
</html>

Pls help me i want the solution for this...........

Recommended Answers

All 10 Replies

please post your code as attachment...

I guess if you really wanted a solution, you'd use [code] tags. Do you get an error on the third page after submitting from the second. Had you tried a print_r($_POST); just to see what is being posted?

Hi,,,,,
find the attachement................

Please post database also...

I see one drop down on the second page called "category" and you are looking for
$_POST, plus you have no values in your <option> tags.

select html:

<select name="category" id="category">
<option selected="selected">service_category</option>
<option>servicetype</option>
<option>services</option>
<option>others</option>
</select>

Hi
pls find the attachement

I got the error with your database:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'businessName` varchar(45) collate latin1_general_ci NOT NULL,

What i wanted to do is........if he wants to enter the new service name then he will select the others..........so their he should enter what service he is providing........and it should inside the db............for the service_category, service_type.and services.......it is already having values inside db and it is displaying those values..............

ok...........but actually i want the correct flow
in the first page it will store its not a problem.......but second page i want the only selected values should be stored inside db.......i dont know where i am wrong....how to store array in a session and how to retrieve it and how to store in db.......i am trying all possible ways nothing is working fine............

In second page you just register session variables.
But not insert any info in that:

$emailid=$_POST['emailid'];
		$password=$_POST['password'];
		$conpass=$_POST['conpass'];
		$businessname=$_POST['businessname'];
		$streetaddress=$_POST['streetaddress'];
		$zip=$_POST['zip'];
		$phoneareacode=$_POST['phoneareacode'];
		$phoneprefix=$_POST['phoneprefix'];
		$phonesuffix=$_POST['phonesuffix'];
		$faxareacode=$_POST['faxareacode'];
		$faxprefix=$_POST['faxprefix'];
		$faxsuffix=$_POST['faxsuffix'];
		$contactfirstname=$_POST['contactfirstname'];
		$contactlastname=$_POST['contactlastname'];
		$comments=$_POST['comments'];
		session_register("emailid");
		session_register("password");
		session_register("conpass");
		session_register("businessname");
		session_register("streetaddress");
		session_register("zip");
		session_register("phoneareacode");
		session_register("phoneprefix");
		session_register("phonesuffix");
		session_register("faxareacode");
		session_register("faxprefix");
		session_register("faxsuffix");
		session_register("contactfirstname");
		session_register("contactlastname");
		session_register("comments");
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.