![]() |
| Domain Name Sales | Domain Software | Calculate UK Domain Drop Dates | Domain Registration | NameDrive | Domain Parking | Subscribe to our Domains For Sale newsletter |
| | ||||||
| Home | Register | Rules | Membership Upgrade | Domains For Sale | Domain Name Escrow | Mark Forums Read | Domain Classified | Chat Room |
| Scripts and Coding PHP, MySQL, scripts |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
![]() | Are your sites up or down [code to tell]
A few weeks ago I didn't notice that one of my site's went down. It was down for 3 weeks. I was busy and didn't check it. It went down for me not paying a renewal for a domain that I wanted to expire. The registrar changed the DNS on all domains in the account (I guess because of non-payment although I hadn't had notification because there was an old email on the account). Basically, I wasn't on top of things and I got screwed. The website that was down for 3 weeks has of course been killed by Google. It was on the first page bringing in about $100 of affiliate income a month.... So since I found out I wanted to create a script (on a webpage) that will be my homepage and tell me if my sites are running ok. I'm sure it can be improved (design/accuracy). There may be false negatives. I've pasted it below as it might help some people keep an eye on your sites. basically copy and paste the code below into a new file (call it something like sitecheck.php) then upload it to your a single site. You can then access the status of your websites by going to your domain.com/sitecheck.php You should of course change the websites in the code to your websites and also delete the related lines of code if you have fewer than 31 sites (or add more, if you have more) PHP Code:
__________________ Connect with me @ TW:LI:FB | MyWeb | D/L domains4sale | Morecambe London Student Forums Student Books UK promotions agencies |
| |
| | #3 (permalink) |
![]() |
Thanks JMOT - I wish you had told me about it a year ago ! (or even a month ago) I'll check it out. Update: Pingdom does seem pretty cool and reliable - it'll just cost me over $40/month to keep an eye on 30+ sites. Of course it's awesome because it sends out SMS alerts, and lets you know even if you don't visit a specific webpage.
__________________ Connect with me @ TW:LI:FB | MyWeb | D/L domains4sale | Morecambe London Student Forums Student Books UK promotions agencies Last edited by woopwoop; 14-07-2010 at 05:35:15 PM. Reason: update |
| |
| | #5 (permalink) |
![]() Join Date: Jan 2007 Location: Barnsley, South Yorkshire
Posts: 523
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Domain Trader Rating: (100% / 22) |
This might be a better solution PHP Code: PHP Code: Craig |
| |
| | #6 (permalink) |
![]() |
Thanks SV - I should credit the source that I got part of the code above - can't remember atm. Your code looks shorter and maybe easier - can you educate me on why else it's better. I'm still learning PHP and if there are efficiencies it can really help me (server process overload happens a fair bit on shared hosting)
__________________ Connect with me @ TW:LI:FB | MyWeb | D/L domains4sale | Morecambe London Student Forums Student Books UK promotions agencies |
| |
| | #7 (permalink) |
![]() |
__________________ Make cash from your website, any website, any sector... That.co.uk Find out more |
| |
| | #8 (permalink) | |
![]() Join Date: Jan 2007 Location: Barnsley, South Yorkshire
Posts: 523
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Domain Trader Rating: (100% / 22) | Quote:
The code I posted simply checks port 80 through PHP's fsockopen function. If port 80 is available, the site is up, if not, it's down. This would be much quicker than the code you posted as that example uses CURL which would basically spider the actual page of the website, therefore loading all content on the page, which would in turn make it slower. This would be much more noticeable when more sites are added. Hope this helps, if you have any specific questions just let me know Kind Regards, Craig | |
| |
| | #9 (permalink) |
![]() |
Thanks Craig. I love php and have made some cool stuff happen with it. Trouble is I always recycle other people's snippets of code and don't really learn how to to it (and forget how I did it...) I patched together a free sms service (free to visitors, but cost me a few p/txt) and so I think I can connect your code to my sms service api and be sent a message if a website is down... (another project for the pile)
__________________ Connect with me @ TW:LI:FB | MyWeb | D/L domains4sale | Morecambe London Student Forums Student Books UK promotions agencies |
| |
| | #10 (permalink) |
| Member |
I have been using: http://www.catswhocode.com/blog/how-...rver-using-php Just make sure you use it on a site hosted on a different server to the ones being monitored otherwise it's useless :P |
| |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Domain Name Community | Replies | Last Post |
| Sites which collect articles automatically somehow?? | woopwoop | Website Design | 0 | 30-10-2008 05:10:15 AM |
| Domain Parking Versus Mini Sites | Billy | General Domain Parking | 6 | 26-07-2008 03:24:07 PM |
| Adsense Allowed sites | golddiggerguy | Internet Marketing | 4 | 15-11-2007 11:09:13 PM |