Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Testing to see if a website is online with php?
Old 02-01-2008, 03:10 PM Testing to see if a website is online with php?
Novice Talker

Posts: 10
Name: Cooper.
Location: Waterloo, Ontario. Canada.
Trades: 0
Im looking to create a simple php script that "pings" a website to see if it is online and returns a response of either up, or down.

Anyone have any suggestions on how to go about this?
housefire is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-01-2008, 08:10 PM Re: Testing to see if a website is online with php?
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
i asked about this a while back, you need to use sockets. off the top of my head i forget some of the code
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 02-01-2008, 11:24 PM Re: Testing to see if a website is online with php?
tazmanny's Avatar
Banned

Posts: 16
Name: manuel
Trades: 0
why with the ping? .... what host are you using? it only took me 4 mins to create my account and have the site up and running... you own your own domain? if so, try checking http://www.000webhost.com/?id=7648

create an account ( is free ) if you have a domain put it there, if not get the subdomain option, the site will be up and running right after you get the comfirmation email. below is a pic of the message you get when a newly created site adress is entered in the adress bar...



Last edited by tazmanny; 02-01-2008 at 11:27 PM..
tazmanny is offline
Reply With Quote
View Public Profile
 
Old 02-01-2008, 11:54 PM Re: Testing to see if a website is online with php?
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
I found this searching around: http://articles.techrepublic.com.com...2-5234592.html
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 02-04-2008, 01:12 AM Re: Testing to see if a website is online with php?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
First of all you have to define what does the "site is online" mean.

In general case you can fetch some page from the target site and then check whether it contains some unique test string, e.g. <title>. This can be done with file_get_contents() if your php settings allow url wrappers or with curl_*() functions if curl extension is installed or with sockets if two previous are unavailable or if you need more control on timeouts.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to Testing to see if a website is online with php?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.51147 seconds with 12 queries