0

我有一个表格:

$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' ].' "但它也没有帮助。有人可以建议该怎么做或问题出在哪里?

4

2 回答 2

2

在后面加上引号method="post

$html.='<div class="grid-round">
            <form method="post" action="">
于 2013-09-05T14:01:52.267 回答
0

您在 $ 后缺少下划线,在 post 后缺少双引号

尝试:

echo '<form method="post" action="'.$_SERVER['REQUEST_URI'].'" >
     ......
     ......
     ......';
于 2013-09-05T14:04:50.053 回答