0

索引.php:

    <form action="update_db.php" method="post">
    <?php
        require_once 'modules/' . $currentModule . '.php';
    ?>      
    </form>  

模块/ some_module .php

...
<input type="submit" />
...

update_db.php:

@extract( $_POST );
print_r( $_POST );

加载 index.php 后,我看到需要表单。但在提交期间,我来到了同一页面(index.php)。为什么?


http://****/admin/

这是生成的 html 代码:http: //dpaste.com/93396/


太奇怪了,但是表单生成了2次......我删除了所有部分代码并重写了它。现在一切都很好。谢谢大家。

4

2 回答 2

1

我看了你的网站。您的表单操作是 index.php,这就是为什么您在单击提交后仍然看到同一页面的原因。如果您上面的代码是正确的,请确保<form>您的模块中没有包含提交按钮的标签。

<form action="index.php" method="post">
<table align="center">

    <tr>
        <td>Логин: </td>
        <td><input type="textfield" name="login" /></td>
    </tr>
    <tr>
        <td>Пароль: </td>
        <td><input type="password" name="password" /></td>
    </tr>

    <tr>
        <td></td>
        <td align="right"><input type="submit" name="submit" value="вход" /></td>
    </tr>
<table>
</form>
于 2009-09-14T12:41:41.750 回答
0

你有这个:

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

不是这个:

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

更改它,您的表单将发布到update_db.php

于 2009-09-14T12:49:57.607 回答