Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $tok_url = "URL";
- $token_post = array(
- 'username' => "username",
- 'password' => "password"
- );
- $curl_log = fopen("malinda/curl.txt", 'rw');
- $curl = curl_init();
- $options = array(
- CURLOPT_PORT => "8069",
- CURLOPT_URL => $tok_url,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => "",
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 30,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_SSL_VERIFYPEER => 0,
- CURLOPT_SSL_VERIFYHOST => 0,
- CURLOPT_VERBOSE => 1,
- CURLOPT_STDERR => $curl_log,
- CURLOPT_CUSTOMREQUEST => "POST",
- CURLOPT_POSTFIELDS => $token_post,
- CURLOPT_HTTPHEADER => array("cache-control: no-cache")
- );
- curl_setopt_array($curl, $options);
- $response = curl_exec($curl);
- $err = curl_error($curl);
- curl_close($curl);
- print_r($err);
- if ($err) {
- return false;
- } else {
- return json_decode($response);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement