PHP GET方法未定义索引

时间:2014-02-03 12:22:15

标签: php .htaccess

我的表单有问题,这是我表单的脚本

<form method='GET' action=''>
    <table>
        <tr>
         <td>Enter username </td>
         <td>:</td>
         <td><input type='text' name='user'></td>

        </tr>
    </table>
</form>

该表单重定向到SELF,这是我的.htaccess文件:

RewriteRule ^admin/borrow$ admin/index.php?p=cpanel&m=manageBorrow [L]

但它显示了用户变量的未定义索引,

有谁能帮我解决?

感谢

1 个答案:

答案 0 :(得分:1)

来自documentation

  

当替换URI包含查询字符串时,RewriteRule的默认行为是丢弃现有查询字符串,并将其替换为新生成的查询字符串。使用[QSA]标志会导致查询字符串合并。

因此要附加查询字符串,请添加QSA标志,如下所示:

RewriteRule ^admin/borrow$ admin/index.php?p=cpanel&m=manageBorrow [QSA,L]