Hi All,
I have a problem.this page is shown very nicely.It opening from the previous page with the value of sid,aid and user but when user giving the value in all fields and clicking on submit button it opens error page instead of thankyouInsert.php.It goes at that time error1.htm(u will find it at bottom)Actuallly it works very nicely atfirst but when i have covered all the script by sid,user,aid then it is doing that(u will find top and bottom of myscript)in this way means opens error1.htmCan you suggest where is my problem?
My code is:
<?php
include('conn.php');
$user=$_REQUEST['user'];
$sid=$_REQUEST['sid'];
$query1= "select * from session where user='$user' and sid='$sid'";
$result=mysql_query($query1)or die(__LINE__.mysql_error());
$row_result=mysql_num_rows($result);
if($row_result>0)
{
if (isset($_POST['B1'])) {
$area= empty( $_POST['T1'])?'':$_POST['T1'];
$date= empty( $_POST['date'])?'':$_POST['date'];
$areaid= empty( $_POST['D1'])?'':$_POST['D1'];
$country= empty( $_POST['T2'])?'':$_POST['T2'];
$budget= empty( $_POST['T3'])?'':$_POST['T3'];
$budgetid= empty( $_POST['D4'])?'':$_POST['D4'];
$dura= empty( $_POST['T4'])?'':$_POST['T4'];
$durid= empty( $_POST['D5'])?'':$_POST['D5'];
$submit= empty( $_POST['B1'])?'':$_POST['B1'];
$aid= empty( $_POST['aid'])?'':$_POST['aid'];
$bud=$budget."$";
If ( $submit == "Submit" ) {
$ins="INSERT INTO `destination` ( `area` , `areaid` , `country` , `budget` , `budgetid` , `duration` , `durid`,`ddate`)
VALUES ('$area','$areaid','$country','$bud','$budgetid','$dura','$durid','$date')";

mysql_query($ins) or
die ("Cannot insert into database into user.");
header("location: /ThankyouInsert.php?aid=$aid&sid=$sid&user=$user");
}
}
?>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Home Page</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<LINK href="main.css" type=text/css rel=stylesheet>

</head>

<body BGCOLOR="#F2EDF3" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0" link="#737E8B" vlink="#4C535C" alink="#737E8B">
<center>

<TABLE WIDTH=780 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD height="15">
</TD>
</TR>
</TABLE>

<TABLE WIDTH=780 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD COLSPAN=2 width=665 height=31 bgcolor="#ACBAC7" >

</TD>
<TD ROWSPAN=2>
<IMG SRC="images/2.banner_top0_02.gif" ALT="" width="115" height="61"></TD>
</TR>
<TR>
<TD>
<IMG SRC="images/2.banner_top0_03.gif" ALT="" width="419" height="30"></TD>
<TD bgcolor="#ACBAC7" width=246 height=30 >
</TD>
</TR>
</TABLE>


<TABLE cellspacing="0" cellpadding="0">
<TR>
<TD>
<IMG SRC="images/2.banner_top_04.gif" ALT="" width="780" height="13"></TD>
</TR>
</TABLE>


<TABLE WIDTH=780 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD>
<IMG SRC="images/Inside_Pic_01.gif" ALT="" width="140" height="111"></TD>
<TD>
<IMG SRC="images/Inside_Pic_02.gif" ALT="" width="157" height="111"></TD>
<TD>
<IMG SRC="images/Inside_Pic_03.gif" ALT="" width="176" height="111"></TD>
<TD>
<IMG SRC="images/Inside_Pic_04.gif" ALT="" width="150" height="111"></TD>
<TD>
<IMG SRC="images/Inside_Pic_05.gif" ALT="" width="157" height="111"></TD>
</TR>
</TABLE>
<!--
<TABLE WIDTH=780 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD>
<IMG SRC="images0/pic2.gif" ALT="" ></TD>
</TR>
</TABLE>
//-->

<TABLE WIDTH=780 BORDER=0 CELLPADDING=0 CELLSPACING=0 bgcolor="#4C535C">
<TR>
<TD width=22 height=25 >

</TD>
<TD>
<a href="index.php">
<IMG SRC="images/Manue_02.gif" width=58 height=25 ALT="" border="0"></a></TD>
<TD WIDTH=22 HEIGHT=25>
</TD>
<TD>
<a href="about.htm">
<IMG SRC="images/Manue_04.gif" width=99 height=25 ALT="" border="0" ></a></TD>
<TD WIDTH=21 HEIGHT=25 >
</TD>
<TD>
<a href="tours.php">
<IMG SRC="images/Manue_06.gif" WIDTH=69 HEIGHT=25 ALT="" border="0" ></a></TD>
<TD WIDTH=20 HEIGHT=25 >
</TD>
<TD>
<a href="great_deals.php">
<IMG SRC="images/Manue_08.gif" WIDTH=126 HEIGHT=25 ALT="" border="0" ></a></TD>
<TD WIDTH=17 HEIGHT=25 >
</TD>
<TD>
<a href="http://www.faresforstudents.com/sing_hotels.htm">
<IMG SRC="images/Manue_10.gif" WIDTH=77 HEIGHT=25 ALT="" border="0" ></a></TD>
<TD WIDTH=22 HEIGHT=25 >
</TD>
<TD>
<a href="http://www.faresforstudents.com/index.php">
<IMG SRC="images/Manue_12.gif" WIDTH=97 HEIGHT=25 ALT="" border="0" ></a></TD>
<TD WIDTH=19 HEIGHT=25 >
</TD>
<TD>
<a href="contact.htm">
<IMG SRC="images/Manue_14.gif" WIDTH=88 HEIGHT=25 ALT="" border="0" ></a></TD>
<TD WIDTH=23 HEIGHT=25 >
</TD>
</TR>
</TABLE>

<!-- MIDDLE ROW START //-->
<TABLE WIDTH=780 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<!-- MIDDLE_LEFT COLUMN START //-->
<TD VALIGN=TOP bgcolor="#ACBAC7" >

<TABLE WIDTH=178 BORDER=0 CELLPADDING=0 CELLSPACING=0 height="61">
<TR>
<TD COLSPAN=3 bgcolor="#ACBAC7" height="10">
<IMG SRC="images/Inside_P_left_01.gif" ALT="" width="150" height="8"></TD>
</TR>
<TR>
<TD WIDTH=7 HEIGHT=48 bgcolor="#ACBAC7" >
</TD>
<TD width="171" height="48" bordercolor="#ACBAC7" bgcolor="#ACBAC7" colspan="2">
<p align="center" class="head">&nbsp;
</TD>
</TR>
<center>




<center>

<TR>
<TD height="3">
<IMG SRC="images/spacer.gif" WIDTH=7 HEIGHT=1 ALT=""></TD>
<TD height="3">
<IMG SRC="images/spacer.gif" WIDTH=162 HEIGHT=1 ALT=""></TD>
<TD height="3">
<IMG SRC="images/spacer.gif" WIDTH=5 HEIGHT=1 ALT=""></TD>
<TD height="3">
<IMG SRC="images/spacer.gif" WIDTH=3 HEIGHT=1 ALT=""></TD>
<TD height="3">
<IMG SRC="images/spacer.gif" ALT="" width="1" height="1"></TD>
</TR>
</TABLE>


</center>


</center>


</TD>


<!-- MIDDLE_LEFT COLUMN END //-->
<!-- MIDDLE_right COLUMN start //-->
<TD valign=top bgcolor="#737E8B">



<TABLE WIDTH=602 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD valign=top bgcolor="#ACBAC7" width=602 height=27 >
<!-- top Sub_menu start //-->

<CENTER>
<TABLE width="559"><TR><TD height=22 width="551" >
</TD></TR></TABLE>
</CENTER>

<!--top Sub_menu End //-->

</TD>
</TR>
<TR>
<TD valign=top bgcolor="#FFFFFF" width=602 height=250 >
<center>

<TABLE WIDTH=572 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<tr><td height=30 ></td></tr>
<tr><td height=2 >
<center>
<form name="form1" method="POST" action="<? echo $_SERVER['PHP_SELF'] ?>">
<table border="0" width="350" bgcolor="#F2EDF3">
<tr><td height=30 width="375" colspan=2 bgcolor="#EAE1EC" >Destination
Table filled up form</td></tr>
<tr><td width="200" align="right">
<p align="right">Area</td>
<td width="200">
<p align="center"><input type="text" name="T1" size="20"></p>
</td></tr>
<input type="hidden" name ="aid" value="<?php echo $_REQUEST['aid'];?>">
<tr><td width="200" align="right">
<p align="right">Area Id</td>

<td width="200">
<p align="center"><select size="1" name="D1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select></p>
</td></tr>
<tr><td width="200" align="right" ><p align="right">
Country</p>
</td>
<td width="200">
<p align="center"><input type="text" name="T2" size="20"></p>
</td></tr>
<tr><td width="200" align="right" >Budget</td>
<td width="200">
<p align="center">
<input type="text" name="T3" size="20">$</p>
</td></tr>
<tr><td width="200" align="right" >Budget Id</td>
<td width="200">
<p align="center">
<select size="1" name="D4">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select></p>
</td></tr>
<tr><td width="200" align="right" >Duration</td>
<td width="200">
<p align="center">
<input type="text" name="T4" size="20"></p>
</td></tr>

<tr><td width="200" align="right" >Duration Id</td>
<td width="200">
<p align="center">
<select size="1" name="D5">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select></p>
</td></tr>
<tr><TD class=TDstyle width="170">
<input onClick="myExample11=open('cal1.htm','myExample11','resizable=no,width=350,height=270');
if (myExample11.opener == null) myExample11.opener = self" type=button value="Date Of Departure" name="button"></td>
<TD class=TDstyle width="200">
<p align="center">
<input name="date" size=10 READONLY></p>
</td></tr>
<tr><td width="320" colspan=2 ><p align="center"><input type="submit" value="Submit" name="B1">
</td></tr>
</table>
</form>
</center>
</TD>
</TR>
</TABLE>
</TD>
<!-- MIDDLE_right COLUMN END //-->
</tr>
</TABLE>
<!-- MIDDLE ROW END //-->




<!-- LOWER MENU START //-->
<TABLE WIDTH=780 HEIGHT=1 BORDER=0 CELLPADDING=0 CELLSPACING=0 >
<TR>
<TD height=24 bgcolor="#4C535C" width="780" height="24">

<CENTER>
<TABLE width="642"><TR><TD height=22 width="634" >
<p class="b_menu" align="center">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<a href="index.php" class="b_menu">&nbsp;HOME&nbsp;</a>&nbsp;&nbsp;&nbsp;
||&nbsp;&nbsp;&nbsp; <a href="about.htm" class="b_menu">ABOUT
US</a>&nbsp;&nbsp;&nbsp;&nbsp; ||&nbsp;&nbsp;&nbsp;&nbsp;<a href="tours.php" class="b_menu">&nbsp;TOURS&nbsp;</a>
&nbsp;&nbsp;
||&nbsp;&nbsp;&nbsp;&nbsp;<a href="great_deals.php" class="b_menu"> GREAT DEALS</a>
&nbsp;&nbsp;&nbsp;
||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.faresforstudents.com/sing_hotels.htm" class="b_menu">HOTELS</a>&nbsp;&nbsp;&nbsp;
||&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.faresforstudents.com/index.php" class="b_menu">AIRFARES</a>&nbsp;&nbsp;&nbsp;&nbsp;
||&nbsp;&nbsp;&nbsp;&nbsp; <a href="contact.htm" class="b_menu">CONTACT</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</p>
</TD></TR></TABLE>
</CENTER>

</TD>
</TR>
</TABLE>
<!-- LOWER MENU END //-->

<!-- BOTTOM START //-->
<TABLE WIDTH=780 BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>
<TD width=780 height=34 bgcolor="#ACBAC7" >
<p align="center" class="mm"><font face="MS Sans Serif" color="#355373">
2005 Honeymoon Makers All Rights Reserved. |&nbsp; Design : <a class="mm" href="http://www.featuredhost.com">Websys</a></font></p>
</TD>
</TR>
<TR>
<TD width=780 height=20 >
</TD>
</TR>
</TABLE>
<!-- BOTTOM eND //-->
</body>
<? }
else header("Location: /error1.htm");
?>