selected responses on form are not picked up on 2nd php page
I have a section of code that I'm stumped on how to handle. The Selected options on the drop down menues are not being picked up on the seco开发者_开发技巧nd PHP page. That is to say the variables error, error1 & error2 on the second page remain blank. I had the same issue with other variables, but was able to fix them with $_POST, but not sure how to handle this with the query.
This form worked great on our main server, but doesn't want to work on the PHP enabled Qnap. Here is the section of script for page 1. It pulls the information from a database. It is displayed correctly on the users screen. at the bottom is page 2
$result19 = mysql_query("SELECT * FROM struc order by number DESC limit 1");
$f = mysql_fetch_array($result19);
$i = 100;
$zx = 0;
for ($i =100; $i<=$f[number] ; $i +100){
$result11 = mysql_query("SELECT * FROM catagory where number = '$i' ORDER BY catagory");
$w = mysql_fetch_array($result11);
?>
<tr>
<td width="269" bgcolor="#284357"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"><b>
<?
echo "$w[catagory]";
?>
</b></font></td>
<td width="47" bgcolor="#284357">
<input type="radio" name="chk" value="<? echo $i; ?>">
</td>
<td width="398" bgcolor="#284357">
<select class=texta name="<? echo $i; ?>" onchange="changeRadio(document.forms[0].chk,this,<? echo $zx; ?>)">
<option>
<?
$result8 = mysql_query("SELECT * FROM struc where number = '$i' ORDER BY name ");
if ($h = mysql_fetch_array($result8)) {
do{
?>
<option>
<? echo $h[name]; ?>
</option>
<?php
}
while($h = mysql_fetch_array($result8));
}
?>
</select>
</td>
</tr>
<?
$zx = $zx + 1;
$i = $i + 100;
}
?>
Now the problem script on page 2
$result19 = mysql_query("SELECT * FROM struc order by number DESC limit 1");
$f = mysql_fetch_array($result19);
$n = 0;
for ($i = 100; $i <= $f[number] ; $i + 100)
{
if ($$i != "")
{
$y[$n] = $$i;
$n = $n + 1;
}
$i = $i + 100;
}
$error = $y[0];
$error1 = $y[1];
$error2 = $y[2];
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">1.
<? echo $error; ?>
<font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">
</font> </font></p>
<input type="hidden" name="error" value="<? echo $error; ?>">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">2.
<? echo $error1; ?>
</font></p>
<input type="hidden" name="error1" value="<? echo $error1; ?>">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">3.
<? echo $error2; ?>
</font></p>
<input type="hidden" name="error2" value="<? echo $error2; ?>">
I'm guessing that's not the whole page, anyways I see on the first page tag opens twice, but closes only once I'd check the HTML you get, it might hold the answer
精彩评论