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...
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.