This is my first page nfdata.php
<form action='drop.php' method='get'>
<tr>
<td ><input type="radio" name="radio" value="DGSTO 1">DGSTO 1</td>
<td><input type="submit" name="sub" value="Submit">
This is my 2nd page drop.php
<html>
<form id="form" action"drop.php" method="get">
<select id="office" name="code">
<?php
include 'sql.php';
if($div = $_GET['radio'])
{
$div = $_GET['radio'];
$query="SELECT off_code_nf From non_filer where div_code_nf='$div' group by off_code_nf";
$sql = mysql_query($query);
// $row = mysql_fetch_assoc($sql);
//echo "<select name='to_user'>";
while ($row = mysql_fetch_assoc($sql))
{
echo "<option value='". $row['off_code_nf'] ."'>" .$row['off_code_nf'] ."</option>" ;
}
//echo "</select>" ;
}
?>
</select>
<input type="submit" name="sub" value="Submit" />
<br><br>
<?php
include 'sql.php';
$inventory = $_GET['code'];
$query= "SELECT * FROM non_filer WHERE off_code_nf = '$inventory' ";
$result = mysql_query($query);
if ($inventory = $_GET['code'])
{
echo "<table border='1'>
<tr>
<th>State Code</th>
<th>GSTIN</th>
</tr>";
}
while ( $row = mysql_fetch_assoc( $result ) )
{
$a = $row['state_code_nf'];
$b = $row['gstin_nf'];
Print("<tr >");
print("<td >$a</td>");
print("<td >$b</td>");
}
print("</table>");
?>
</html>
I used get method in nfdata.php and get value of radio button in second page drop.php where it is selecting data from data base. but after selecting value from drop down When I am clicking on submit in drop.php page the value of drop down is not coming because there is new get method. so how to keep the value of first get method