Laimonas171
2009-07-22 17:26:23
i got php code which one perfectly works on localhost (wampserver) but then i put same *.php into server it doesn't work.
in local host i write http://localhost/index.php?world=10 it shows perfectly, $time value (code gets players amount and calculate $time formula)
in server side http://myaddress/index.php?world=10 it always gets 2000 amount of players, and calculates same time 750 on this script because it using always "full" amount of players (2k).
an ideas why is it?
[PHP]
<?php <?php $world = $_GET["world"];
$data = file_get_contents("http://www.runescape.com/slu.ws");
$search = strstr($data, "World {$world}");
$players = substr($search, 21 + strlen($world), 4);
$players = trim($players);
$players = (is_numeric($players) ? $players : 2000);
$a = 1500;
$b = 3;
$c = 8;
$x = 60;
$time = $a - ( $b * $players / $c);
echo round($time);
?>[/PHP]
in local host i write http://localhost/index.php?world=10 it shows perfectly, $time value (code gets players amount and calculate $time formula)
in server side http://myaddress/index.php?world=10 it always gets 2000 amount of players, and calculates same time 750 on this script because it using always "full" amount of players (2k).
an ideas why is it?
[PHP]
<?php <?php $world = $_GET["world"];
$data = file_get_contents("http://www.runescape.com/slu.ws");
$search = strstr($data, "World {$world}");
$players = substr($search, 21 + strlen($world), 4);
$players = trim($players);
$players = (is_numeric($players) ? $players : 2000);
$a = 1500;
$b = 3;
$c = 8;
$x = 60;
$time = $a - ( $b * $players / $c);
echo round($time);
?>[/PHP]