find out website availability without server code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dentrite
Forum Newbie
Posts: 16
Joined: Thu Jun 17, 2010 7:10 am

find out website availability without server code

Post by dentrite »

hi all, i am having a blog which does not supports codes on server, means i can put no code on the page, i am starting a domain registration business and for it i need to check website availability through ajax or javascript, if site is available it should show "call me, site is available", else "try something else". pls if somebody to crack to write some code for me, i would really be thankful. thanks in advance
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: find out website availability without server code

Post by social_experiment »

The Manual wrote:gethostbyname — Get the IP address corresponding to a given Internet host name
You could send a request to see if an ip address is returned for the given domain name, if it returns an ip you know it exists, and false is returned on failure.
Hth
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
dentrite
Forum Newbie
Posts: 16
Joined: Thu Jun 17, 2010 7:10 am

Re: find out website availability without server code

Post by dentrite »

can somebody provide full implementation of the above idea?
Post Reply