PHP to JavaScript covert?
#12

If you're using it in an iframe you could just:

PHP код:
<html>
<script type="text/javascript">
setInterval ( "reloadPage()", 5000 );

function reloadPage ( )
{
    window.location.reload();
}
</script>
<?php

getstats
("24.111.46.103""7777");

function 
getstats($ip$port)
{
  
$fp fsockopen('udp://' $ip$port$errno$errstr,0.0);
  if (!
$fp)
  {
     echo 
"offline";
  }
  else
  {
    
$packet 'SAMP';
    
$packet .= chr(strtok($ip'.'));
    
$packet .= chr(strtok('.'));
    
$packet .= chr(strtok('.'));
    
$packet .= chr(strtok('.'));
    
$packet .= chr($port 0xFF);
    
$packet .= chr($port >> 0xFF);

    
fwrite($fp$packet.'i');
    
fread($fp11);

    
$is_passworded ord(fread($fp1));
    
$plr_count     ord(fread($fp2));
    
$max_plrs      ord(fread($fp2));
    
$strlen        ord(fread($fp4));
    
$hostname      htmlentities(fread($fp$strlen));
    
$strlen        ord(fread($fp4));
    
$gamemode      htmlentities(fread($fp$strlen));
    
$strlen        ord(fread($fp4));
    
$mapname       htmlentities(fread($fp$strlen));
    
    if(
$is_passworded == 1)
    {
        
$is_passworded "yes";
    }
    else if(
$is_passworded == 0)
    {
        
$is_passworded "no";
    }    
    
    echo 
"Hostname  : $hostname " "<br>";
    echo 
"Gamemode : $gamemode ""<br>";
    echo 
"Map : $mapname ""<br>";
    echo 
"Players: $plr_count/$max_plrs""<br>";
    echo 
"Passoword: $is_passworded""<br>";
    
    
fwrite($fp$packet.'c');
    
fread($fp11);
    
fclose($fp);
 }    
}
?>
</html>
Reply


Messages In This Thread
PHP to JavaScript covert? - by sciman001 - 05.11.2011, 03:40
Re: PHP to JavaScript covert? - by Calgon - 05.11.2011, 07:57
Re: PHP to JavaScript covert? - by sciman001 - 05.11.2011, 16:01
Re: PHP to JavaScript covert? - by Norn - 05.11.2011, 16:16
Re: PHP to JavaScript covert? - by Ronaldo_raul™ - 05.11.2011, 16:23
Re: PHP to JavaScript covert? - by sciman001 - 05.11.2011, 18:54
Re: PHP to JavaScript covert? - by sciman001 - 05.11.2011, 18:56
Re: PHP to JavaScript covert? - by Pinguinn - 05.11.2011, 18:57
Re: PHP to JavaScript covert? - by sciman001 - 05.11.2011, 18:59
Re: PHP to JavaScript covert? - by Norn - 05.11.2011, 19:01
Re: PHP to JavaScript covert? - by sciman001 - 05.11.2011, 19:02
Re: PHP to JavaScript covert? - by Norn - 05.11.2011, 19:09
Re: PHP to JavaScript covert? - by sciman001 - 05.11.2011, 19:32
Re: PHP to JavaScript covert? - by sciman001 - 05.11.2011, 19:35
Re: PHP to JavaScript covert? - by Flyfishes - 05.11.2011, 19:37
Re: PHP to JavaScript covert? - by sciman001 - 05.11.2011, 19:37
Re: PHP to JavaScript covert? - by Calgon - 05.11.2011, 19:38

Forum Jump:


Users browsing this thread: 2 Guest(s)