我是这个网站的新手,也是编程。将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