PHP error message: call to undefined function
(Disclaimer) MY php experience is approx 2 hours old and I have know idea what I am doing.
This is my error and I am wondering how do you know where the error is, for example.
as rendered in my browser, this is my error.
Fatal error: Call to undefined function array_key_exist() in
/h开发者_Python百科ome/mjcrawle/public_html/cit/home/processlogin.php on line 47
Line 47 is actually if (array_key_exist('submit', $_post)){
I do not know if the error is before or after - this is my code.
/*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);
}
The function is array_key_exists
, not array_key_exist
:).
emphasis on the latter s
function name is array_key_exists() (your forgot S in "exists")
The error is saying that the function array_key_exist
doesn't exist - reason for this is because you forgot to add an 's' at the end. The actual function name is array_key_exists
.
Try this:
/*Determine if the form data was submitted*/
if (array_key_exists('submit', $_post)){
/*this removes left over data*/
$emailaddress = sanitize($_post['emailaddress']);
$password = sanitize($_POST['password']);
/*verify form data*/
$auth_status = validateLogin($emailaddress, $password);
}
精彩评论