suresh kumar
suresh kumar

Reputation: 193

Parse.com PHP setup

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.

Upvotes: 0

Views: 477

Answers (1)

bwash70
bwash70

Reputation: 1155

I had the same issue after modifying my ParseClient.php file. Try reinstalling Parse PHP and it should work.

If you look in your ParseClient.php file at line 240 it will have file_get_contents[snip].

If you look in Parse's ParseClient.php file it doesn't have this.

Upvotes: 1

Related Questions