页面没有提交

问题描述:

这个代码是用于显示数据和更新数据。当查询字符串设置好的文本框appersand提交按钮也会出现页面没有提交

<!DOCTYPE html> 
<!-- 
To change this license header, choose License Headers in Project   Properties. 
To change this template file, choose Tools | Templates 
and open the template in the editor. 
--> 
<html> 
    <head> 
    <meta charset="UTF-8"> 
    <title></title> 
</head> 
<body> 
<from action="category_listing.php" method="post"> 
    <table border="5" width="250"> 
    <?php 
     $queryy="select COUNT(*) from category"; //count rows 
     $results= mysqli_query($link, $queryy); 
     while ($res= mysqli_fetch_array($results)) 
     {$total_rows=$res[0];} 
     $offset=$total_rows-1; 
     $qry="select ID from category LIMIT $offset,1"; 
     $res= mysqli_query($link, $qry); 
     while ($res2= mysqli_fetch_array($res)) 
     { 
      $lastvalue=$res2[0]; 
     } 

     $query="select * from category"; 
     $result= mysqli_query($link, $query); 
     while ($r= mysqli_fetch_array($result)) 
     { 
      if(isset($_REQUEST['id']) && is_numeric($_REQUEST['id'])  &&  ($_REQUEST['id']>=0) && $_REQUEST['id']<=$lastvalue) 
       { 
       $id=$_REQUEST['id']; 
       if($r[0]==$id) 
       { 
        $name=$r[1]; 
        echo '<tr><td>'; 
        echo 'Name'; 
        echo '</td>'; 
        echo '<td><input type=text value="'.$r[1].'"></td></tr>'; 
        echo '<tr><td colspan="2">'; 
        echo '<input type="submit" name="btnupdate" value="Update">'; 
        echo '<input type="submit" value="Cancel">'; 
        echo '</td></tr>'; 

       } 
       } 
      else 
      { 
       static $var=1; 
       if($var==1){echo '<tr><th>ID</th><th>Name</th>  <th>Action</th></tr>';} //headers of category 
       echo "<tr><td>$r[0]</td><td>$r[1]</td>"; 
       echo "<td><a  href='category_listing.php?id=$r[0]'>Edit</a></td></tr>"; 
       $var++; 
      } 
     } 

    ?> 
    </table> 
    <input type="hidden" name="hidden" value="<?php if(isset($id)) echo $id;?>"/> 
</from> 
</body> 
</html> 

我只设置查询字符串。当它被设置在URL中时。文本框出现,按下提交后,页面不提交。

+0

'from'和'/ from'应'form'和'/ form' – Stefan 2015-02-08 18:49:06

变化

<from action="category_listing.php" method="post"> 

<form action="category_listing.php" method="post"> 

</from></form>