All,
Can anyone tell me a way where I can ping a particular site to see if it is up or not.
For example, if I gave a URL in the code it should check if the site is up and running or not.
If someone can explain this with an example code it would be great.
Thanks in advance.
Php code to ping a website
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
fsockopen()
Hint: If my memory serves me correctly there's an example written by someone in a thread at the bottom....
If not you essentially try to open a socket on port 80 (use @ at the front to surpess error output) and test if it returns true or false....
EDIT | My memory served me wrongly... the there's a tutorial on Spoono.com for this (see link in my signature)...
Hint: If my memory serves me correctly there's an example written by someone in a thread at the bottom....
If not you essentially try to open a socket on port 80 (use @ at the front to surpess error output) and test if it returns true or false....
EDIT | My memory served me wrongly... the there's a tutorial on Spoono.com for this (see link in my signature)...
Oh yeah! really good tutorials.d11wtq wrote: EDIT | My memory served me wrongly... the there's a tutorial on Spoono.com for this (see link in my signature)...
I really like the ones that take you through creating something useful, gives me a better understanding of how to use things in the 'real world' environment.