This file contains 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
[ | |
{ | |
"image_id":"mmwVV74", | |
"hits":"2", | |
"first_view":"1356242044" | |
}, | |
{ | |
"image_id":"jSOxa38", | |
"hits":"5", | |
"first_view":"1356245094" |
This file contains 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
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { |
This file contains 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
NSURL *url = [NSURL URLWithString:[receiveItem objectForKey:@"image"]]; | |
NSData *imageData = [NSData dataWithContentsOfURL:url]; | |
UIImage *itemImage = [UIImage imageWithData:imageData]; | |
itemImageView = [[UIImageView alloc] initWithImage:itemImage]; |
This file contains 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 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 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 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 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 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 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 |