| Author | Message | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| Re: php request: $uptime displayed on website
Okay, this could be completely wrong... But It's also just an idea. But, These websites that check your port like "canyouseeme.org" If you're running your server and you check the port that your server runs through the port checker can see your service.
|
| Re: php request: $uptime displayed on website
Hey there, I have a solution to your issue! It's probably REALLY ugly code but it is a solution none the less.. Assuming you know how to set up cron jobs? ( Which are basically just a list of scripts/programs that the computer will execute at regular intervals of which you define, I know how toin linux, I don't know if there's something similar in windows) I have written a simple PHP script that will connect to the server you assign it to, and will update a table called "serverinfo" (which it will create if it doesn't exist within your eoserv database) and increment a field called"uptime" by the interval which you set in minutes and display how long the server has been up, in minutes. Also I thought ahead and decided to add a little "security" feature if you will so your uptime can't be fucked with. you have to browse to uptime.php?accesskey=abcdefg in order for the scriptto fully execute and you can change this access key if you should so desire, just be sure to make sure you assign the accesskey in your cron job :) If you wish to use this basic script I can work on it some more to make it more suited to your requirements but it's the best I/anyone has come up withso far by the looks of it? Here's the script: https://tehsausage.com/paste/uptime //doesn't create a table. Look to my next post for this fix. Any more info needed, just message back --- If money doesn't grow on trees, then why do banks have branches?
|
| Re: php request: $uptime displayed on website
DanScott posted: (30th Apr 2012, 05:43 pm) Do you got a HTML script for this?
|
| Re: php request: $uptime displayed on website
Uh, I don't think HTML has quite the capabilities of PHP so far as connecting to a server :L so in answer to your question, no. Sorry. Also, it has been pointed out that my script in my previous post doesn't actually create the table haha. Apologies for that guys. You can find the rectified version here https://tehsausage.com/paste/uptimerecifiedfinallol that will hopefully successfully create the table if you do not have it in your database currently.
--- If money doesn't grow on trees, then why do banks have branches?
|
| Re: php request: $uptime displayed on website
thanks man, its just what I wanted, a solution that works --- Beware of your thoughts, they become your words. Beware of your words, they become your actions. Beware of your actions, they become your habits. Beware of your habits, they become your character. Beware of your character, it becomes your destiny. - Unknown
|
| Re: php request: $uptime displayed on website
No worries, I hope you get this working :) --- If money doesn't grow on trees, then why do banks have branches?
|
| Re: php request: $uptime displayed on website
me? bwahaha I'm no coder.. it's all you dude --- Beware of your thoughts, they become your words. Beware of your words, they become your actions. Beware of your actions, they become your habits. Beware of your habits, they become your character. Beware of your character, it becomes your destiny. - Unknown
| |
