0

I have a host where going my key and hid check. Host is showing there are no any requests.

NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:@"http://host/key.php?keys=cf7dc026e243bf862d60256099a63e58n2gc49b56d84a2148c130d2c010ff87feb3f&hid=1"]];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
[[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
    NSString *requestReply = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
    NSLog(@"Request reply: %@", requestReply);
}] resume];

There is my Key.php, where is going check for key and hid. All server code written on php. Server is MySQL. Server encoding is a UTF8

<?php
require 'config.php';
ob_end_clean();
$response = null;
$license = R::findOne('license', ' key_code = ? ', array(
$_GET['keys']
));
 if (is_null($license)) $response = set_response(false, 400,         "Key doesn’t exist");
   else if(intval(strtotime($license->data_okonch))==0 ||         $license->hid == "nulled") $response = set_response(false, 400, "Key zeroed");
 else if (intval(strtotime(date("Y-m-d"))) >      intval(strtotime($license->data_okonch))) 
 $response =set_response(false, 400, "License expired");
 {
 else if (is_null($license->hid))
 $license->hid = $_GET['hid'];
 R::store($license);
 $response = set_response(true, 200, "Successful. HID was updated");
}
else if (strval($_GET['hid']) == strval($license->hid))            $response = set_response(true, 200, "Successful, HID wasn’t updated");
else if (strval($_GET['hid']) != strval($license->hid))          $response = set_response(false, 400, "HID doesn’t match");

Once I finally sended request, I don’t know how. I don’t changed code and later it again doesn’t work

0 Answers0