PHP代码中input控件使用id无法POST传值,使用name就可以

<html>
<head>
<title>Example</title>
</head>
<body>
<?php
if (isset ( $_POST ['input1'] )) {
    echo "input1 = " . $_POST ['input1'];
} else {
    echo "input1 = is not set";
}
if (isset ( $_POST ['input2'] )) {
    echo "input2 = " . $_POST ['input2'];
} else {
    echo "input2 = is not set";
}
?>
    <form method="post" action="/index.php">
        登录用户名<input name="input1" value="" type="text" /> 密码<input
            name="input2" value="" type="password" /> <input name="signin"
            value="登录" type="submit" />
    </form>
</body>
</html>

posted @ 2015-12-09 21:01  aprial  阅读(903)  评论(0编辑  收藏  举报