<? if(($_GET['xml'])&&($_GET['callback'])){ $url = strip_tags($_GET['xml']); $callback = strip_tags($_GET['callback']); header('Content-Type: text/javascript; charset=utf-8'); if($xml = @simplexml_load_file('http://'.$url)){ $json = json_encode($xml); }else{ $json = 'null'; } echo $callback.'('.$json.');'; } ?>
<? if(($_GET['json'])&&($_GET['callback'])){ $url = strip_tags($_GET['json']); $callback = strip_tags($_GET['callback']); header('Content-Type: text/javascript; charset=utf-8'); if($json = @file_get_contents('http://'.$url)){ // }else{ $json = 'null'; } echo $callback.'('.$json.');'; } ?>