View Full Version : Server Tracker
Jeplaa
8th April 2013, 14:43
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
$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.
kung foo man
8th April 2013, 14:49
there is no other way ;(
Jeplaa
8th April 2013, 14:50
So I thought, thanks for reply.
STAUFFi
29th April 2013, 12:44
this works only for Minecraft
STAUFFi
29th April 2013, 13:01
Edit i can give you my script ->
252
Jeplaa
29th April 2013, 13:19
Hey StauFFi,
Well there is no problem about code. Just asked about fOpen() function, since hostings are not allowing this feature.
EvoloZz
29th April 2013, 14:38
Isn't fOpen() just for opening files? You ment fSockOpen()?
Jeplaa
29th April 2013, 16:15
Yep, that's right.
STAUFFi
30th April 2013, 14:33
make
<?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);
?>
Kemi
2nd December 2015, 16:04
make
<?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?
maxdamage99
6th December 2015, 09:48
Kemi use it:
<?php
$ipserver = "1.0.1.0"; // Ip your server
$fp = fsockopen("udp://$ipserver", 14400, $errno, $errstr);
$contents = fread($fp, filesize($filename));
fclose($fp);
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.