简体   繁体   English

表单上的选定响应未在第二个php页面上显示

[英]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 second PHP page. 下拉菜单上的“选定”选项未在第二个PHP页面上被拾取。 That is to say the variables error, error1 & error2 on the second page remain blank. 也就是说,第二页上的变量error,error1和error2保持空白。 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. 我在其他变量上也遇到了同样的问题,但是可以通过$ _POST来解决它们,但是不确定如何通过查询来解决。

This form worked great on our main server, but doesn't want to work on the PHP enabled Qnap. 这种形式在我们的主服务器上工作得很好,但是不想在启用PHP的Qnap上工作。 Here is the section of script for page 1. It pulls the information from a database. 这是页面1的脚本部分。它从数据库中提取信息。 It is displayed correctly on the users screen. 它在用户屏幕上正确显示。 at the bottom is page 2 底部是第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 现在第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; ?>">

我猜那不是整个页面,无论如何我在首页标签上看到打开了两次,但是只有在我检查得到的HTML时才关闭,它可能包含答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM