Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_GET['request_url'] =="http://public-crest.eveonline.com/incursions/"){
- $file = fopen("last_update.txt","r");
- $contents = fread($file,filesize("last_update.txt"));
- fclose($file);
- if(time()>($contents+3600)) {
- $file = fopen("last_update.txt","w");
- fwrite($file,time());
- fclose($file);
- $ch = curl_init($_GET['request_url']);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- curl_setopt($ch, CURLOPT_USERAGENT,'Site: put your site here or whatever, Contact: [email protected]');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $remote_file = curl_exec($ch);
- $header_size = curl_getinfo($ch,CURLINFO_HEADER_SIZE);
- $result['header'] = substr($remote_file, 0, $header_size);
- $result['body'] = substr($remote_file, $header_size );
- //echo $result['header'];
- echo $result['body'];
- curl_close($ch);
- $file = fopen("incursions.data","w");
- fwrite($file,$result['body']);
- fclose($file);
- }
- else {
- $file = file_get_contents("incursions.data");
- echo $file;
- }
- }
- else
- echo "forbidden";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment