Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-09-2011, 01:38 PM   #1
qwe
Confirmed User
 
Join Date: Jul 2003
Posts: 2,109
php script...

just need simple script to check domains if they're working... like adding let's say 50 domains and when I execute php file it will check if they're loading or dead... thanks
qwe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-09-2011, 02:45 PM   #2
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
If you are looking to invest a few bucks for this technology, hit me up, icq: 33375924
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-09-2011, 03:05 PM   #3
junction
Confirmed User
 
Industry Role:
Join Date: Dec 2002
Location: Midwest
Posts: 2,411
Quote:
Originally Posted by woj View Post
If you are looking to invest a few bucks for this technology, hit me up, icq: 33375924
Shoot me an email dave [at] plbnetmedia [dot] com. Software / programming project.
junction is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-09-2011, 03:10 PM   #4
potter
Confirmed User
 
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
This is a quick crude method but it should do it, let me know if it works (don't pay someone for <10 lines of code) ;)

Just set the list of URLS in the urls variable.

Code:
<?php
	$urls = array('http://google.com','http://yahoo.com');
	foreach ($urls as $value) {
		$siteCheck = get_headers($value);
		$statusCode = substr($siteCheck[0] , 9, 3);
		if ($statusCode >= 400) {
			print $value . ': Down<br />';
		} else {
			print $value . ': Up<br />';
		}
	}
?>
__________________


Last edited by potter; 07-09-2011 at 03:12 PM..
potter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-09-2011, 03:49 PM   #5
Aka_Bluey
Confirmed User
 
Aka_Bluey's Avatar
 
Industry Role:
Join Date: Sep 2007
Posts: 631
/edit. you only wanted to test sites not server, this script tests the server probly not what you wanted.


Freeware SERVER_ONLINE_TEST PHP script - Check status (online/offline) of the chosen web server(s).
http://www.adamek.biz/server_online_test/



.
__________________
Things that make ya go hmmmm....

Last edited by Aka_Bluey; 07-09-2011 at 03:52 PM..
Aka_Bluey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-09-2011, 04:06 PM   #6
potter
Confirmed User
 
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
Quote:
Originally Posted by pornopete View Post
Heaven forbid somebody gets paid for their time!


Ok, please send me $1.60 - because that's what writing that code above would be at my hourly rate.

so much for a webmaster forum
__________________

potter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-09-2011, 04:08 PM   #7
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,242
Quote:
Originally Posted by qwe View Post
just need simple script to check domains if they're working... like adding let's say 50 domains and when I execute php file it will check if they're loading or dead... thanks
http://codecanyon.net/item/uptime-we...nitoring/86651

5 bucks
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-09-2011, 04:21 PM   #8
Kiopa_Matt
Confirmed User
 
Industry Role:
Join Date: Oct 2007
Posts: 1,448
xMarkPro will do that. Bit more than $5 though. Also allows you to specify a small phase for each domain, and it ensures that phrase shows up on the home page. Helps prevent against server errors, hosting account suspensions, etc.
__________________
xMarkPro -- Ultimate Blog Network Management
Streamline your marketing operations. Centralize management of domains, pages, Wordpress blogs, sponsors, link codes, media items, sales and traffic statistics, plus more!
Kiopa_Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-09-2011, 07:01 PM   #9
qwe
Confirmed User
 
Join Date: Jul 2003
Posts: 2,109
Quote:
Originally Posted by potter View Post
This is a quick crude method but it should do it, let me know if it works (don't pay someone for <10 lines of code) ;)

Just set the list of URLS in the urls variable.

Code:
<?php
	$urls = array('http://google.com','http://yahoo.com');
	foreach ($urls as $value) {
		$siteCheck = get_headers($value);
		$statusCode = substr($siteCheck[0] , 9, 3);
		if ($statusCode >= 400) {
			print $value . ': Down<br />';
		} else {
			print $value . ': Up<br />';
		}
	}
?>
gives me Fatal error: Call to undefined function: get_headers() in /www/users/check.php on line 4
qwe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-09-2011, 07:37 PM   #10
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,242
Quote:
Originally Posted by qwe View Post
gives me Fatal error: Call to undefined function: get_headers() in /www/users/check.php on line 4
its a php5 function, dont tell me you are still using php4
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-09-2011, 08:24 PM   #11
qwe
Confirmed User
 
Join Date: Jul 2003
Posts: 2,109
Quote:
Originally Posted by fris View Post
its a php5 function, dont tell me you are still using php4
im not sure what the host uses
qwe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-10-2011, 12:41 AM   #12
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Here is a simple Perl script tutorial: http://perl.about.com/od/appliedprog...icemonitor.htm

Maybe, that would work better in your situation ...

To get your server's PHP version;
in SSH or terminal:
Quote:
$ php -v
or in a file

PHP Code:
<?php
phpinfo
();

?>
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-10-2011, 07:51 AM   #13
raymor
Confirmed User
 
Join Date: Oct 2002
Posts: 3,745
For a more solid version, you might like our clonebox monitoring system. The simple code posted generally won't alert you to a completely broken page with an error message, for example, or a hacked page.
The sort simple page will also sometimes say that a sure is down when actually everything is ok.

Clonebox checks every few minutes and emails you or sends you an SMS if it's down for more than five minutes. Clonebox can even automatically switch to a backup server when the site goes down.
__________________
For historical display only. This information is not current:
support&#64;bettercgi.com ICQ 7208627
Strongbox - The next generation in site security
Throttlebox - The next generation in bandwidth control
Clonebox - Backup and disaster recovery on steroids
raymor is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-10-2011, 08:31 AM   #14
potter
Confirmed User
 
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
Quote:
Originally Posted by qwe View Post
im not sure what the host uses
Fris is right, you definitely shouldn't be using php4 any more. I'm sure your host allows you to switch your account to php5. You can email them and ask or simply google "myhostcompanyname switch to php5".

Usually if you're on a shared host and they have you default to php4, you can easily switch to php5 by adding "AddHandler application/x-httpd-php5 .php" to your htaccess file.
__________________

potter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2011, 07:44 PM   #15
qwe
Confirmed User
 
Join Date: Jul 2003
Posts: 2,109
Quote:
Originally Posted by potter View Post
Fris is right, you definitely shouldn't be using php4 any more. I'm sure your host allows you to switch your account to php5. You can email them and ask or simply google "myhostcompanyname switch to php5".

Usually if you're on a shared host and they have you default to php4, you can easily switch to php5 by adding "AddHandler application/x-httpd-php5 .php" to your htaccess file.
anyway to do it in php 4 ?
qwe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2011, 07:48 PM   #16
CYF
Coupon Guru
 
CYF's Avatar
 
Industry Role:
Join Date: Mar 2009
Location: Minneapolis
Posts: 10,973
Quote:
Originally Posted by qwe View Post
anyway to do it in php 4 ?
php4 was obsolete in 2008. Time to upgrade.
__________________
Webmaster Coupons Coupons and discounts for hosting, domains, SSL Certs, and more!
AmeriNOC Coupons | Certified Hosting Coupons | Hosting Coupons | Domain Name Coupons

CYF is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-11-2011, 08:05 PM   #17
amateurcanada
Confirmed User
 
amateurcanada's Avatar
 
Industry Role:
Join Date: Jul 2001
Posts: 3,766
coders lol
__________________

be our partner - join nichepartners today
will.assum.producer @ AmateurCanada.com / icq: 30146166 / facebook.com/will.assum / #amateurcanada
amateurcanada is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.