表格总是以POST方式提交为GET

时间:2015-02-26 21:20:06

标签: php html forms

我的表单提交存在问题。代码如下。当我提交时,它提交为GET而不是POST,即使我的方法是post。我试过method =“POST”和method =“post”。我在这里缺少什么?

<!doctype html>
<html>

<head>
    <title>Test</title>
    <meta charset="utf-8" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
</head>

<body>
    <div>
        <?php 
            echo "POST: "; 
            print_r($_POST); 
            echo " GET :"; 
            print_r($_GET); 
        ?>

        <form role="form" name='test' method=“post” action="test2.php">
            <label for="name">Name</label>
            <input name="name" type="text" />
            <input type="submit" name="submit" />
        </form>

    </div>
</body>

0 个答案:

没有答案