?
Solved

IP ping for online check

Posted on 2006-10-31
6
Medium Priority
?
243 Views
Last Modified: 2012-05-05
Hi,

I would like to know which is the best way (cause I can't find a decent one) to ping an IP in PHP. The system() command doesn't seem to be working on my webserver. Every time i try to ping an 145.84.x.x, no method seems to be working.

The thing I want is like a status checker which displays if the IP is online or offline.

Thank you in advance.
0
Comment
Question by:Destralak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 4

Expert Comment

by:KellyCraig
ID: 17850520
Did you try an
echo passthrough(ping x.x.x.x);
??

--Kelly
0
 

Author Comment

by:Destralak
ID: 17856424
Fatal error: Call to undefined function: passthrough() in /storage/mijndomein/users/045364/public/sites/uren.destralak.info/test.php on line 2

I'm using PHP Version 4.3.10-16.

Is this a PHP5 function? Because at newyear my host will switch to PHP5 =)

to i_am_aamir: I already checked that out, but the functions mentioned there doesn't seem to work here (read above; the system command doesn't seem to be working)
0
 
LVL 4

Accepted Solution

by:
KellyCraig earned 1000 total points
ID: 17859495
Hey.
yes, unfortunately that is a PHP5 function.
It worked like a charm on my php test.

However, with passthrough the page will take as long to load as it takes for the ping to finish and then display in cleartext as it would at a command prompt with no way to format it without parsing it.

--Kelly
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question