Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $query_string = "";
- if ($_REQUEST)
- {
- $kv = array();
- foreach ($_REQUEST as $key => $value)
- {
- $kv[] = stripslashes($key) . "=" . stripslashes($value);
- }
- $query_string = join("&", $kv);
- }
- if (!function_exists('curl_init'))
- {
- die('Sorry cURL is not installed!');
- }
- $url = 'https://api.vultr.com/v1/server/reboot';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, count($kv));
- curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string);
- curl_setopt($ch, CURLOPT_HEADER, FALSE);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, FALSE);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
- $result = curl_exec($ch);
- curl_close($ch);
- var_dump($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement