主要是测试用
js代码
function getData(){
var d = document;
var account = d.getElementById('account').value;
console.log(account);
var password = d.getElementById('password').value;
axios.post('/register.php',{
firstName:'cdd',
password:'123456'
})
.then(function (response) {
console.log(response);
d.getElementsByClassName('h3')[0].innerHTML = response.data;
})
.catch(function (error) {
console.log(error);
});
}
这个是php代码
<?php echo 'cdd的名字是:'.$_REQUEST['firstName'];?>
总是出这样的错误
Notice: Undefined index: firstName in D:\phpStudy\WWW\register.php on line 3cdd的id是:
郎朗坤
随时随地看视频慕课网APP
相关分类