Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!isset($_GET['keyID']) || empty($_GET['keyID']))
- {
- echo "keyID is not set or is empty";
- return;
- }
- if(!isset($_GET['vCode']) || empty($_GET['vCode']))
- {
- echo "keyID is not set or is empty";
- return;
- }
- // create curl resource
- $ch = curl_init("https://api.eveonline.com/account/APIKeyInfo.xml.aspx?keyID=" . $_GET['keyID'] . "&vCode=" . $_GET['vCode']);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- // $response contains the XML response string from the API call
- $response = curl_exec($ch);
- // If curl_exec() fails/throws an error, the function will return false
- if($response === false)
- {
- // Could add some 404 headers here
- echo 'Curl error: ' . curl_error($ch);
- }
- else
- {
- $apiInfo = new SimpleXMLElement($response);
- $accessMask = (int)$apiInfo->result->key->attributes()->accessMask;
- // Echo back the accessMask as a response
- echo $accessMask;
- }
- // close curl resource to free up system resources
- curl_close($ch);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement