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>
übertragen Ich habe ein paar Probleme mit diesem Code, ich mache ein ATM Visual Web. Ich möchte Daten von HTML-Datei zu PHP-Datei übertragen, ich weiß, ich muss "Formular" verwenden, aber ich weiß nicht, wie man es in diesem Fall verwendet, ich benutze auch "Skript" zu lösen, wenn Benutzer einen falschen Wert eingeben.Wie kann ich Daten von HTML zu PHP in diesem Fall
<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>
Was soll ich tun, um es zu beheben?
Erstellen Sie ein Formularobjekt in der Methode process_Login und dann Daten anhängen und Post –
folgen Sie Ihrer Idee, ich muss ein Formular in meinem
Wenn Sie ein Formular tun, werden Sie posten Sie es in Ihrem PHP-Skript. Ihre Eingaben müssen ein Namensattribut haben, das heißt,
auf Ihrem PHP-Skript, können Sie Ihre Felder mit $ _POST zugreifen [ 'username'] usw.
Quelle
2016-04-21 02:33:58 user3480964
danke dir so sehr, ich habe es geschafft! –
}
Quelle
2016-04-21 03:39:16 Tosif