This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "/classes/Database.php"; | |
header("Content-type: text/json"); | |
$dbinfo = array( | |
"host" => "127.0.0.1", | |
"user" => "root", | |
"pass" => "", | |
"name" => "hiskor" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "/classes/Database.php"; | |
header("Content-type: text/json"); | |
$dbinfo = array( | |
"host" => "127.0.0.1", | |
"user" => "root", | |
"pass" => "", | |
"name" => "hiskor" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendResponse($status, $body = '') | |
{ | |
$status_header = 'HTTP/1.1 ' . $status; | |
header($status_header); | |
header('Content-type: application/json'); | |
echo $body; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Send HTTP Response Method | |
function sendResponse($status, $body = '') | |
{ | |
$status_header = 'HTTP/1.1 ' . $status; | |
header($status_header); | |
header('Content-type: application/json'); | |
echo $body; | |
} | |
// Calling the HTTP Response Method with parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function login() | |
{ | |
global $HTTP_RAW_POST_DATA, $db; | |
// remove the second argument or pass false if you want to use an object | |
//$user_info = json_decode($HTTP_RAW_POST_DATA, false); | |
// Check for required parameters | |
if (isset($_POST['username']) && isset($_POST['passwordMD5'])) | |
{ | |
//Put parameters into local variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function register() | |
{ | |
global $db; | |
if (isset($_POST['username']) && isset($_POST['passwordMD5']) && isset($_POST['email'])) | |
{ | |
$username = mysql_real_escape_string($_POST['username']); | |
$passwordMD5 = mysql_real_escape_string($_POST['passwordMD5']); | |
$email = mysql_real_escape_string($_POST['email']); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function login() | |
{ | |
global $db; | |
// remove the second argument or pass false if you want to use an object | |
//$user_info = json_decode($HTTP_RAW_POST_DATA, false); | |
// Check for required parameters | |
if (isset($_POST['username']) && isset($_POST['password'])) | |
{ | |
//Put parameters into local variables |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"sql_error":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''username', 'password', 'email') VALUES ('test', 'test', 'test')' at line 1"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)btnLogout:(id)sender { | |
TabBarViewController *tabBarViewControllerObj = [[TabBarViewController alloc] init]; | |
[Lockbox setString:@"FALSE" forKey:kLoggedinStatusKeyString]; | |
[tabBarViewControllerObj loginCheck]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HomeTableViewController | |
- (IBAction)btnLogout:(id)sender { | |
self.animateBOOL = YES; | |
[Lockbox setString:@"FALSE" forKey:kLoggedinStatusKeyString]; | |
[(TabBarViewController *)[self tabBarController] loginCheck:animateBOOL]; | |
} | |
// TabBarViewController |