<script>
function login() {
var userN = document.getElementById("userN").value;
var pin = document.getElementById("pin").value;
if (userN == "") {
alert("User name not entered");
document.getElementById("userN").focus();
}
else if (pin == "") {
alert("PIN Number not entered");
document.getElementById("pin").focus();
}
else {
var userAccount = "User Name:" + userN + "\n" +
"Pin:" + pin;
alert("userAccount");
}
}
</script>
</head>
<body>
<h2>Please enter your User Name and PIN:</h2>
<form name="formLogin" action="">
<action="loginLog.php" method="post">
<p><label for="userN">User Name: </label>
<input type="text" name="userN" id="userN" size="20" maxlength="8" tabindex="1"></p>
<p><label for="pin">PIN Number: </label>
<input type="password" name="pin" id="pin" size="20" maxlength="8" tabindex="2"></p>
<input type="submit" onclick="return login();" />
<input type="reset" onclick="document.formLogin.userN.focus();" />
</form>
我在使用 $_Post 捕获和回显以显示在登录页面上提交的数据时遇到问题。我不确定在登录页面上获取此数据以推送到 loginLog.php 我缺少什么
这是我的 loginLog.php 文件
<body>
Welcome
<?php
echo $_POST["userN"];
?>
<?php
echo $_POST["pin"];
?>
</body>
元芳怎么了