为什么错误地重定向

时间:2013-09-05 13:55:33

标签: php html redirect uri

我有一个表格形式:

$html.='<div class="grid-round">
            <form method="post action="">
                <table class="grid-table">
                    <tr>
                        <th><input type="checkbox" ></th>
                        <th>name</th>
                        <th>type</th>
                        <th>date</th>
                        <th>Stat</th>
                    </tr>
                     ...
                </table>
                <button>save</button>
            </form>
</div>';

它所在的页面位于地址:

www.example.com/admin?cid=53&user_id=10

但是当我按下按钮时,它会重定向我:

www.example.com/admin

我已经推入action=" '.$SERVER[ 'REQUEST_URI' ].' ",但也没有帮助。有人可以建议做什么或问题在哪里?

2 个答案:

答案 0 :(得分:2)

method="post之后添加引用:

$html.='<div class="grid-round">
            <form method="post" action="">

答案 1 :(得分:0)

您在$和发布后的双引号

后缺少下划线

尝试:

echo '<form method="post" action="'.$_SERVER['REQUEST_URI'].'" >
     ......
     ......
     ......';
相关问题