我是這個網站的新手,也是編程。將post數據傳遞給php函數
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Login page</title>
<script> //This is the client side form validation with Javascript
//This code is executed on the client's browser
function validateForm()
{
var x=document.getElementById("username").value;
if (x==null || x=="") //check that the name field is not blank
{
alert("Your username must be filled out");
return false;
}
var y =document.getElementById("password").value;
if (y==null || y=="") //check that the project field is not blank
{
alert("Your password must be filled out");
return false;
}
}
</script>
<?php //This is the server side form validation with PHP
//This code executes on the web server
//Write your server side form validation code here
//checks form is submitted
我想從用戶名和密碼獲取數據通過此功能進行處理。我幾個小時一直在搞這個,終於放棄了。你能幫忙的話,我會很高興。
功能checkUserData(){$用戶名= $ _ POST [」用戶名'];你的意思是這樣的嗎? – David