Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created August 13, 2013 11:57
Show Gist options
  • Save niraj-shah/6220391 to your computer and use it in GitHub Desktop.
Save niraj-shah/6220391 to your computer and use it in GitHub Desktop.
Logging in a user to Parse with PHP
<?php
require_once( 'parse/parse.php' );
$parse = new parseUser();
$parse->username = 'username';
$parse->password = 'password';
$result = $parse->login();
try {
$result = $parse->login();
if ( $result ) {
// success, set cookie
echo 'Login successful';
} else {
// display error
echo 'Login error';
}
} catch ( Exception $e ) {
echo 'Login error: ' . $e;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment