[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

IP ping for online check

Posted on 2006-10-31
6
Medium Priority
?
245 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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

650 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