Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $name = "silviu";
- $lname = "nuta";
- $email = "testsilviu1234@test.com";
- $password = "123213";
- $phone = "972-9-222236427";
- $countryCode = "200";
- $url = "http://www.empireoption.com/api/";
- $apiUserName = 'api_usr_traderleads';
- $apiPassword = '5sNs92NurH';
- $campaignId = '203';
- $curr = 'EUR';
- //Get country------------------------
- $fields = array(
- 'MODULE' => 'Country',
- 'COMMAND' => 'view',
- 'FILTER[iso]' => 'IS',
- 'api_username' => $apiUserName, //The API Username
- 'api_password' => $apiPassword, //The API Password
- );
- $headers = array(
- 'Content-Type' => 'application/x-www-form-urlencoded',
- );
- $fields_string = '';
- //url-ify the data for the POST
- foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
- rtrim($fields_string, '&');
- try{
- $chCountry = curl_init();
- $headers = array(
- 'Content-Type' => 'application/x-www-form-urlencoded',
- );
- //set the url, number of POST vars, POST data
- curl_setopt($chCountry,CURLOPT_HTTPHEADER, $headers);
- curl_setopt($chCountry,CURLOPT_URL, $url);
- curl_setopt($chCountry, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($chCountry, CURLOPT_HTTPGET, 1);
- $result = curl_exec($chCountry);
- if (FALSE === $result)
- throw new Exception(curl_error($chCountry), curl_errno($chCountry));
- var_dump($result);
- //close connection
- curl_close($chCountry);
- }catch(Exception $e) {
- trigger_error(sprintf(
- 'Curl failed with error #%d: %s',
- $e->getCode(), $e->getMessage()),
- E_USER_ERROR);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement