您的位置:首页 > 编程语言 > PHP开发

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

2015-12-09 21:01 609 查看
<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: