-
Server Tracker
Hey guys,
currently I'm working on my own server-list or server-tracker nvm.
Since my hosting provider is not allowing fSockOpen(), so there is my question is there any other way to get ip and port. Below simple code what I mean:
PHP Code:
<?php
$ip = "127.0.0.1";
$port = "13";
$con = fsockopen("udp://$ip", $port, $errno, $errstr);
if (!$con) {
echo "offline";
} else {
echo "online";
}
?>
Tried on other hosting but they have restricted ports for some reasons.
-
-
So I thought, thanks for reply.
-
this works only for Minecraft
-
1 Attachment(s)
Edit i can give you my script ->
Attachment 252
-
Hey StauFFi,
Well there is no problem about code. Just asked about fOpen() function, since hostings are not allowing this feature.
-
Isn't fOpen() just for opening files? You ment fSockOpen()?
-
-
make
Code:
<?php
$filename = "server.cfg"; // Read Server Data
$fp = fsockopen("udp://ip/".$filename, "14000", $errno, $errstr, 10); // Connected and streamed ip & port
$contents = fread($fp, filesize($filename));
fclose ($fp);
?>
-
Quote:
Originally Posted by
STAUFFi
make
Code:
<?php
$filename = "server.cfg"; // Read Server Data
$fp = fsockopen("udp://ip/".$filename, "14000", $errno, $errstr, 10); // Connected and streamed ip & port
$contents = fread($fp, filesize($filename));
fclose ($fp);
?>
All that does is get the server.cfg if it's located in the directory root?