Hi,
I am creating websites in my event search form i am have 2 options(which is in radio button)one is countryname and another one is state name with search field(Its in first table).If i run my page and i click countryname then it shows country table and then if i entered i want to go another page for result so my codings are in one form design is in one form.In submit form i am using one image.I gave link in image button but its not working.Help me how to give link for this code and i tried header for this but its also not working tell me some suggestion regarding to this.
table design code
code:[PHP]
<form name="search" id="search" method="get" ><br><br><br>
<h2><b><center>Search any Events</center> </b></h2>
<table border="0" align="center">
<tr>
<td><input type="radio" name="searchOption" value="country" onclick="showSelect('country')"></td>
<td>By Countryname</td>
</tr>
<tr>
<td><input type="radio" name="searchOption" value="state" onclick="showSelect('state')"></td>
<td>By Statename</td>
</tr>
<tr>
<td><input type="radio" name="searchOption" value="festival" onclick="showSelect('festival')"></td>
<td>By Festivalname</td>
</tr>
</table><br /><br><br>
<!--Hiding tables-->
<!--Country Details-->
<div id="hiddenTables">
<table border="0" id="country" align="center" class="hide" cellpadding="4">
<tr>
<th colspan="2">Select Country Name</th>
</tr>
<tr>
<td><input type="text" name="countryname" id="countryname" </td>
</tr>
<tr><td class="show"><a href="country.php"><input type="image" name="submit" src="go.gif" /></a>
</td></tr>
<!--Hiding tables with coding for country -->
</table>
<!--State Details-->
<table border="0" id="state" align="center" class="hide" cellpadding="4">
<tr>
<th colspan="2">Select State Name</th>
</tr>
<tr>
<td><input type="text" name="state" id="state"></td>
</tr>
<tr><td><input type="image" name="submit" src="go.gif" />
</td></tr> </table>
[/code]
code:[php]
<b>country.php</b>
<?PHP
include('connect.php');
$string=$_GET['countryname'];
$sql = "SELECT * FROM add_event WHERE countryname ='$string'";
$query = mysql_query($sql) or die(mysql_error());
//$row_sql = mysql_fetch_assoc($query);
$total = mysql_num_rows($query);
if($_GET['submit']=$_GET['countryname'])
{
?>
<table width="700" border="0" align="center" id="countrytable" cellpadding="3" cellspacing="1">
<div align="center"><b>Search Details</b></div>
<tr bgcolor="#E1E1E1">
<td width="14%" bgcolor="#E6E6E6"><strong>Event</strong></td>
<td width="14%" bgcolor="#E6E6E6"><strong>State</strong></td>
<td width="14%" bgcolor="#E6E6E6"><strong>Date</strong></td>
<td width="14%" bgcolor="#E6E6E6"><strong>Month</strong></td>
<td width="14%" bgcolor="#E6E6E6"><strong>Year</strong></td>
</tr>
<?PHP
while ($row_sql = mysql_fetch_array($query))
{//echo out the results
?>
<?PHP
print "<tr bgcolor=\"#CCCCCC\">
<td bgcolor=\"#FFFFFF\">" . $row_sql['event'] ."</td>
<td bgcolor=\"#FFFFFF\">" . $row_sql['state'] ."</td>
<td bgcolor=\"#FFFFFF\">" . $row_sql['date'] ."</td>
<td bgcolor=\"#FFFFFF\">" . $row_sql['month'] ."</td>
<td bgcolor=\"#FFFFFF\">" .$row_sql['year'] ."</td>
</tr> ";
}
if($total!=0)
{
echo"<B>Totally $total events are found</B><br>You searched for $string";
}
else
{
echo"<center><b>no events found.<br>
Check weather u entered $string is spelled correctly or not </b>";
}
}
//var_dump(mysql_fetch_array($query));
?>
[/code]