这是我的第一页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">
这是我的第二页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>
答案 0 :(得分:0)
<html>
<form id="form" action"drop.php" method="get">
<select id="office" name="code">
<?php
include 'sql.php';
$radioVal = $_GET['radio'];
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="hidden" name="radio_val" value="<?=$radioVal?> />
<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>
点击第二页上的提交按钮
时使用$ _GET ['radio_val']