"Offline/Online" Server Status PHP Code.

Post your Custom Scripts or Packages.

Moderator: POL Developer

Post Reply
User avatar
MontuZ
Forum Regular
Posts: 338
Joined: Fri Feb 10, 2006 8:08 am
Location: Myrtle Beach, South Carolina

"Offline/Online" Server Status PHP Code.

Post by MontuZ »

This actually took me awhile to find and figure out because I don't have any clue about coding in php. Any other notes that's needed here that I forgot, or didn't know about please post them here for everyone. And if anyone knows anyother methods of doing this, again please post.

Code: Select all

<?php

error_reporting(0); //If your server is offline, this will keep it from printing an error.

    $fp = fsockopen("POLIP", POLPORT, $errno, $errstr, 1 );
    if (!$fp) {
    echo "Put your HTML Code here. For Offline";
    } 
    else {
    echo "Put your HTML Code here. For Online";
    fclose($fp);
    }
?> 
Last edited by MontuZ on Fri Feb 10, 2006 11:07 am, edited 2 times in total.
User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am
Location: Illinois, USA

Post by Tritan »

I considered trying to implent this into my shard and website. The only reason I have not tried yet is because my website is remotely hosted.

Can this still be done?

My website has support for PhP which I use for my message boards only.
User avatar
MontuZ
Forum Regular
Posts: 338
Joined: Fri Feb 10, 2006 8:08 am
Location: Myrtle Beach, South Carolina

Post by MontuZ »

It 'should' work. Just make sure you're using .php where you put this code. You can take a normal html file and convert it over to .php I use Dreamweaver to do that) and paste the code where you want it to display the online/offline.
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Post by MuadDib »

AasanDar
New User
Posts: 21
Joined: Thu Feb 02, 2006 8:44 am
Location: Beaverton, OR, USA

Post by AasanDar »

OMG MUAD DIB!!! I've been trying to find you forever.

Also..

I've been trying to use those PHP scripts of yours.. but the two that you linked to.. are broken downloads of some sort. I just get a page full of gibberish. I've tried it multiple times from FireFox and IE.

(image removed: broken link)

Also, why I wanted to contact you, was about the rest of your PHP-Nuke scripts.. so if you have time.. please give me a ring.

Thanks much.

-Aasan
Last edited by AasanDar on Mon Aug 27, 2018 8:45 am, edited 1 time in total.
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Post by CWO »

both links work fine for me...
AasanDar
New User
Posts: 21
Joined: Thu Feb 02, 2006 8:44 am
Location: Beaverton, OR, USA

Post by AasanDar »

I have no clue. I've tried Firefox and IE, cleared the cache/cookies, restarted many times.. they never work =/
blah
New User
Posts: 12
Joined: Thu Feb 02, 2006 12:05 pm

Post by blah »

and what about right mouse button and 'save as..'?
I have the same problem as yours with every .rar archive when i 'left click' it, but i can always download it.
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Post by MuadDib »

Nice to see you too aas, lol.

Give me a couple weeks mate, so I can get my PC here. Work has me traveling now (Indianapolis, IN atm). Next is either New York or Florida during the summer after I leave Indy.
AasanDar
New User
Posts: 21
Joined: Thu Feb 02, 2006 8:44 am
Location: Beaverton, OR, USA

Post by AasanDar »

Good deal man, take you're time.

And if anybody feels like it.. it would be cool if someone were to download the files at the following links and e-mail them to me =)

http://www.lostsoulsshard.org/modules.p ... tit&lid=46

http://www.lostsoulsshard.org/modules.p ... tit&lid=10

dustin.dubois@gmail.com
tao4mike

Post by tao4mike »

seems when you get the gibberish (which my firefox does as well) you can just choose FILE > SAVE PAGE AS and it will save the file as whatever.rar and you are good to go..hope this helps :)
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm
Location: Cross Lanes, WV

Post by MuadDib »

I posted it here on the forums for all the freaks who can't download it from there (Yes aas, we all know you are a freak :wink: )
User avatar
CWO
POL Expert
Posts: 1158
Joined: Sat Feb 04, 2006 5:49 pm
Location: Chicago, IL USA

Post by CWO »

The reason is most likely that the file association is off in the registry. Internet Explorer and Firefox are reading it most likely as either a text file or something it can process like an HTML file...

First thing I would check is in the registry under HKEY_CLASSES_ROOT/.rar

if it contains anything other than the "Default" value (If you installed WinRAR, Default will have the value WinRAR.. this is OK), including other subkeys or values, first, Export a backup of your registry values of course, then delete them and retry downloading the file.
AasanDar
New User
Posts: 21
Joined: Thu Feb 02, 2006 8:44 am
Location: Beaverton, OR, USA

Post by AasanDar »

Hey thanks guys. My roommate downloaded them on his computer and it worked fine.. so I just copied it from him.
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Re: "Offline/Online" Server Status PHP Code.

Post by Poi »

I know this is an old topic, but I'm running pol 96 and this is not working, always says offline(The port is correct, as is the ip and players can connect just fine) any ideas?
xeon
Forum Regular
Posts: 338
Joined: Fri Oct 31, 2008 3:18 am
Location: Italy

Re: "Offline/Online" Server Status PHP Code.

Post by xeon »

You PHP doesn't support fsockopen() to a URL? Check you PHP.ini
Post Reply