2
<div id="background">
<div class="form-group">
<label for="usr" style="position:fixed;margin-top:180px;margin-left:900px;"><u>Account ID</u>:</label>
<input type="text" placeholder="Enter your ID in here" class="form-control" id="usr" style="position:absolute;width:350px;margin-top:205px;margin-left:900px;">
</div>
<div class="form-group">
<label for="pwd" style="position:fixed;margin-top:230px;margin-left:900px;"><u>PIN</u>:</label>
<input type="password" placeholder="Enter your PIN in here" class="form-control" id="pwd" style="position:absolute;width:350px;margin-top:255px;margin-left:900px;">
<button type="submit" onClick="process_Login()" class="btn btn-default" style="font-weight:bold;font-family:Tahoma, Geneva, sans-serif;position:fixed;margin-left:1040px;margin-top:310px;width:100px;">Login</button>
<button type="submit" class="btn btn-default" style="font-weight:bold;font-family:Tahoma, Geneva, sans-serif;position:absolute;margin-left:1150px;margin-top:310px;width:100px;">Sign Up</button>
</div>
</div>
我对这段代码有一些问题,我在网上做了一个ATM可视化。我想从HTML文件传输数据到PHP文件,我知道我必须使用“表单”,但我不知道如何在这种情况下使用它,我也使用“脚本”来解决,如果用户输入一个不正确的值。在这种情况下,如何将数据从html传输到php
<script>
function process_Login() {
var c = document.getElementById("usr").value;
var d = document.getElementById("pwd").value;
if (c.length == 0) {
alert("ERROR: Your ID account is NULL");
} else if (isNaN(c)) {
alert("ERROR: Your ID must be number");
}
}
</script>
我该怎么办才能修复它?
在process_Login方法中创建一个表单对象,然后附加数据并发布 –
按照你的想法,我已经在我的
如果你正在做一个表,你会将其发布到您的PHP脚本。 你的投入将需要有一个name属性,即
在你的PHP脚本,你可以用$ _POST [ '用户名']等访问你的领域
来源
2016-04-21 02:33:58 user3480964
非常感谢你,我做到了! –
}
来源
2016-04-21 03:39:16 Tosif