I am creating a web app using parse.com php sdk. I had created a login form and using AJAX to call the parse.com php login function
try {
$user = ParseUser::logIn("myname", "mypass");
// Do stuff after successful login.
} catch (ParseException $error) {
// The login failed. Check error to see why.
}
when I pass the wrong username and password, It returns the following warning.
Warning: file_get_contents(https://api.parse.com/1/login?username=suresh%40inovawe.com&password=password123): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /MyPath/vendor/parse/php-sdk/src/Parse/ParseClient.php on line 240
Warning: Invalid argument supplied for foreach() in /MyPath/vendor/parse/php-sdk/src/Parse/ParseObject.php on line 488
Warning: Invalid argument supplied for foreach() in /MyPath/vendor/parse/php-sdk/src/Parse/ParseObject.php on line 528
And If I pass the correct username and password it returns nothing and in my index.php i have a condition to check user logged in
$currentUser = ParseUser::getCurrentUser();
if ($currentUser) {
// do stuff with the user
echo 'user loggedin';
} else {
include "login.php";
}
it always executes the false block. Can anyone help me to solve it. It will be good if I get a nice tutorials for parse.com php.