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