(免责声明)我的PHP体验大约2个小时,我知道我在做什么.
这是我的错误,我想知道你怎么知道错误在哪里,例如.
在我的浏览器中呈现,这是我的错误.
Fatal error: Call to undefined function array_key_exist() in
/home/mjcrawle/public_html/cit/home/processlogin.php on line 47
Run Code Online (Sandbox Code Playgroud)
第47行实际上是 if (array_key_exist('submit', $_post)){
我不知道错误是在之前还是之后 - 这是我的代码.
/*Determine if the form data was submitted*/
if (array_key_exist('submit', $_post)){
/*this removes left over data*/
$emailaddress = sanitize($_post['emailaddress']);
$password = sanitize($_POST['password']);
/*verify form data*/
$auth_status = validateLogin($emailaddress, $password);
}
Run Code Online (Sandbox Code Playgroud) 我相信我的班级是正确的,但是当我尝试回应班级的输出时,我在第28行得到一个错误:"echo'你的全名......"这一行是第28行.任何帮助都会很好
<?php
echo 'Your full name is ' . $person->retrieve_full_name() . '.';
?>
Run Code Online (Sandbox Code Playgroud)
这是我创建函数" retrieve_full_name "的地方
public function __retrieve_full_name() {
$fullname = $this->firstname . ' . ' . $this->lastname;
return $fullname;
}/* This ends the Full Name Function*/
Run Code Online (Sandbox Code Playgroud)
我得到的错误是
致命错误:在第28行的/home/mjcrawle/processlogin2.php中调用未定义的方法stdClass :: retrieve_full_name()