Well, of course there is a way to ping the remote server. It's a little command-line utility called "ping" ;-). And since PHP can call command line utilities, there you go.
What you have to do is use a command like exec() (
this will run your ping command, and return the output as a array, or string variable, which you can examine using some regular expression or string search.
Then, you have to think about what the returned output of ping will look like, and what expression you want to use to evaluate whether the ping is successful or not. You should play around with the ping command on your server. If it is a unix server, enter "man ping".
I am fairly new to web programming. My background is mostly visual basic. I honestly have no idea what php is. It appears to be some type of server side scripting. do you know of any good resources i could use to get rolling?
Ping will just tell you that there's a connection between the box that initiates the ping, and the remote server that responds to the ping.
With virtual hosting, a multitude of websites could have the same IP address. While the server could respond, the site could still be down (nonpayment, bad permissions, sloppy coding, etc).
In addition, the link could still be a 'dead link' even if the server is up (bad url, typo, etc)
Good rescources? Depends on how you learn. This site, as well as other forum and code repository sites exist. There are also several books out there to read..
If you come from a VB/Microsoft background, you should read thread434-151252. (the ASP->PHP link in this same forum)
PHP is similar to Active Server Pages, except that it is truly cross-platform. PHP runs identically in both Windows and Unix, with some slight variations for some operations that relate to the OS and filesystem. It has a very straightforward, logical structure. Even if you are more familiar with VB, you have probably played around with Javascript some. Well, the good news is that PHP's syntax is very similar to Javascript.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.