ill
May 12 2005, 07:30 PM
| | Does anyone know of a script that will tell people if an IP is online or offline? Like it will ping it like every fifteen minutes or so and will display an online or offline image accordingly. Or at least it supports images, text is fine I guess, but I'd rather it use images.
Any help on this will be appreciated! Thanks! |
Reply
BuffaloHELP
May 12 2005, 07:53 PM
Okay, I am an ancient programmer so I am giving you something that you would laugh at. I believe creating a batch file would be the best at this point. Since batch file would take the minimum CPU resource. Then you can have your Windows scheduler to activate it every 15 minutes. Save it as whatever.bat in any directory. CODE @echo off cls echo Testing connection to forum... echo. ping www.trap17.com -n 20 cls echo Testing connection to mysite... echo. ping www.mysite.domain -n 20 EXIT
Basically, this will open a DOS command window and run its course, then it will EXIT (close the screen). The -n 20 denotes that it will ping 20 times. You can change to whatever number you'd like. Don't forget to replace/add "mysite" with the domain you'd like to ping. For further extensions, type ping /? from your command line. I hope this helps. Cheers.
Reply
HmmZ
May 13 2005, 01:06 AM
if(!mysql_connect(what_ip?)){ ?> <img src="offline.gif"> <? } else { ?> <img src="online.gif"> <? } ?> its based on a simple code that i use to check and show if my forums are online: CODE if(!mysql_connect(localhost, ***, ***)){ ?> <img src="http://online.trap17.com/images/status_offline.gif" border="0" height="14"> <? } else { ?> <img src="http://online.trap17.com/images/status_online.gif" border="0" height="14"> <? } ?> I dont know if it works with an ip instead of localhost tho, and im not sure if it has to select a db and pass. Also, if you want to get a whole list of members to be checked, you could use a db for it, selecting $username and $ip from the db for example: mysql_connect('localhost','db_name','db_password') or die("could not connect to db"); $username= "mysql_query('select username from table')"; $ip= "mysql_query('select ip from table')"; if($username=!$ip){ echo "username doesnt match the ip"; } else{ $connect= mysql_connect($ip);} if(!$connect){ echo "<img src=\"offline.gif\">";} else{ echo "<img src=\"online.gif\">";} something like that? im a newbie php coder so sorry if it is all wrong
Reply
Spectre
May 24 2005, 02:52 AM
Hmm, to ping an IP address from scratch, you would have to harness the ICMP (see RFC792). I suppose it could be done in PHP, but it is quite complex, and due to the nature of the language (it isn't really intended for such purposes), it could get quite resource intensive. Another, more realistic option would be to use the system() function in PHP to execute a PING command and capture the output. I've never actually used it for this specific purpose myself, so I don't know how well it would work. Not all servers allow this though, due to security issues - I don't know if Trap17 does or not. Oh, and BuffaloHELP, Windows batch scripting isn't PHP.
Reply
karlo
May 29 2005, 02:14 PM
Try this: CODE <?php ini_set("default_socket_timeout","05"); set_time_limit(5); $f=fopen("http://www.somesite.com","r"); $r=fread($f,1000); fclose($f); if(strlen($r)>1) { echo("<b>Online</b>"); }else { echo("<b>Offline</b>"); } ?>
Reply
Recent Queries:--
ping ip with php - 14.87 hr back. (1)
-
ping ip php - 17.17 hr back. (1)
-
ping servers to check status html code - 24.30 hr back. (1)
-
php ping mysql - 27.49 hr back. (1)
-
timer for online exam php - 34.15 hr back. (1)
-
ping username - 36.87 hr back. (1)
-
ping ip online - 37.11 hr back. (1)
-
how to ping a ip offline - 41.57 hr back. (1)
-
ping proxy tutorial - 49.44 hr back. (1)
-
computer ping online - 60.85 hr back. (1)
-
php script show host online offline with ping - 66.12 hr back. (1)
-
php check ip status - 73.99 hr back. (1)
-
script to ping a computer every 15 minutes - 80.61 hr back. (1)
-
php ping mysql server - 80.87 hr back. (1)
Similar Topics
Keywords : ping online offline- Php Guest Online Script
- (2)
- Testing Php?
- How can I test it offline? (12)
Hi guys. I'm wanting to learn PHP. Is there a way I can check my code to see if it works
without having to upload it to my server? Could it be that my computer doesnt have PHP installed or
something? Can someone please show me where to download it and how to set it up? Thanks a lot.
help is greatly appreciated....
Html Code Tester. Online Script
- (15)
Yes, yes. I have another script that I have written and I am distributing. I am not entirely sure if
this works. I have not tested it yet, but I will later and post back with a demo and fix it up.
Current script: CODE <?php //Save this as something like htmltest.php function
CheckForm() { $html_unsafe=$_POST['code']; //Gives us our user
input $html_safe=str_replace("<?php"," ",$html_unsafe);
//Starts security measures $html_safe=str_replace("?>","
",$html_sa...
Script That Tracks The User Status
- how can I track on or offline users? (4)
long explaination: hey, I'm building a user profile site right now. And, I kinda know how to
make a online/offline detector, but not totally sure. I know I can make a mysql database to track
them, but how does it entrer the information? I could easily put in a field where when they login it
sets them to online, but if they don't sign out, and just exit the browser, how can I tell.
short: I want someone to tell me how to make a online/offline status detector, like they have here
on trap17. I'd be thrilled if you can post to this, thanks, arcticsnpr...
Very Simple Online Now Script
- This is a very simple online now script. (3)
Hi all, Its Aldo. anyways, I wont be using the method of pagination, i will just tell you how to
make a basic online now script. When someone logs in, now take into consideration that the name of
the username input is username ( First ,create a table in your database saying online now and add 2
fields to it. id and username CODE id type=integer(INT) , auto increment, length =255
and username = VARCHAR length=the limit a username should be in your site now from there we take
off : CODE <?php //logged.php //authentication script //connection scri...
The Artists Tutorials :mysql Basic Commands
- The Artists is an online programming unit and gfx designing clan. (0)
Let's Talk about basic mysql commands used in php. I will now show you a list of the most common
MySQL FUNCTIONS : QUOTE mysql_connect(MySQL server name,username,password) - opens a connection
to a MySQL server. mysql_select_db(database name,connection id) - selects a database residing on
the MySQL server. The database name parameter referes to an active database on the MySQL server that
was opened with the mysql_connect function. The connection identifier is a reference to the current
MySQL connection. mysql_query(sql query) - sends a query to the currently ac...
Beginner's Php Tutorial Online At My Site
- (12)
Hey everyone, over the last week I've been writing a PHP tutorial aimed at absolute beginners
who have never even seen the syntax of PHP before let alone wrote a PHP script! The tutorial
assumes you have a basic knowledge of HTML (for the tutorial you will need to write a couple of
hyper links and forms, nothing complex!) and an internet browser. It tells you about where to
find the other software needed (apache/XAMPP and a script.text editor) and how to check if it is
working. The tutorial is basic and focuses on the use of the ECHO, INCLUDE/REQUIRE and I...
Php Online Test
- (8)
Is there any online PHP / Mysql testing place? I would like to test my PHP knowledge but I have not
found any online ( free ofcourse). ...
Add The Online Proxy To Your Site.
- script:phproxy (0)
it developed by whiteFyre that contained only 5 files: index.php phproxy.class.php javascript.js
url_forum.inc style.css the demo is on http://hbu.com.ru/proxy/ the script is under gpl.you
just can edit every file of this 5. and made your own style of online proxy. enjoy it. PS:If the
member that find your isp is something wrong or block some Ip,just tried this. guangdian...
Users Online Script In Php
- how do i get one? (7)
I've been seeing a whole bunch of sites that have a Statistics corner, and in there, there are
things that says "Users Online:", "Page Loads:", "Unique Hits:", and "IP:". Well, I was wondering,
where do these users get one of these nifty things? I know that PHPNuke offers one, but most of the
sites that I go to do not use PHPNuke. Any reply is appreciated. /smile.gif' border='0'
style='vertical-align:middle' alt='smile.gif' /> ...
Online Exam
- Plz Help me (3)
Hi every one i want to know where can i find php Lan ( online Exam ) i want to make online exam for
my student but i dont know what is good Cms for that ? i need :: 1 - admin area 2 - student ID and
password 3 - logs i need cms i want students login with id and passwords and answers my question
and then i told them whats numer and show them true answer but free do you know where can i find
this kind of php cms i havenot time to write php code /blink.gif' border='0'
style='vertical-align:middle' alt='blink.gif' /> thx any way...
Visitors Online
- With PHP (no MySQL is needed) (9)
Another script, which shows the visitors onlineat the moment in your site. This script was not made
by me, I just think it will be very usefull to u. CODE <? $timeout = 15; // change
it. It is the timer which will delete the member of online list (in minutes) if
(!$datei) $datei = dirname(__FILE__)."/online.txt"; $time
= @time(); $ip = $REMOTE_ADDR; $string =
"$ip|$time\n"; $a = fopen("online.txt", "a+");
fputs($a, $s...
Online Radio?
- (9)
Hey Hows everyone I have a question that i m tryin to figure out....Is it possible {Does anyone know
how to do it} to make a website with a Radio kinda thing on it...and tht u will controll tht radio
from ur pc..so like..u can say anythin on ur headphone n stuff...or can anyone make a program where
pplz will download tht software/program n u will have the controll over it so when u say anythin
from ur computer..the voice will be heard from tht program...well i think it is possible buh i m not
sure how to do it...i m not a good programmer so if anyone knws how to make suc...
Looking for p, ping, online, offline
|
|
Searching Video's for p, ping, online, offline
|
advertisement
|
|