GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   php script... (https://gfy.com/showthread.php?t=1029637)

qwe 07-09-2011 01:38 PM

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

woj 07-09-2011 02:45 PM

If you are looking to invest a few bucks for this technology, hit me up, icq: 33375924

junction 07-09-2011 03:05 PM

Quote:

Originally Posted by woj (Post 18271339)
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.

potter 07-09-2011 03:10 PM

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 />';
                }
        }
?>


Aka_Bluey 07-09-2011 03:49 PM

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



.

potter 07-09-2011 04:06 PM

Quote:

Originally Posted by pornopete (Post 18271419)
Heaven forbid somebody gets paid for their time!

:1orglaugh

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 :upsidedow

fris 07-09-2011 04:08 PM

Quote:

Originally Posted by qwe (Post 18271256)
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

Kiopa_Matt 07-09-2011 04:21 PM

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.

qwe 07-09-2011 07:01 PM

Quote:

Originally Posted by potter (Post 18271370)
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

fris 07-09-2011 07:37 PM

Quote:

Originally Posted by qwe (Post 18271625)
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

qwe 07-09-2011 08:24 PM

Quote:

Originally Posted by fris (Post 18271663)
its a php5 function, dont tell me you are still using php4

im not sure what the host uses

Barry-xlovecam 07-10-2011 12:41 AM

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
();

?>


raymor 07-10-2011 07:51 AM

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.

potter 07-10-2011 08:31 AM

Quote:

Originally Posted by qwe (Post 18271700)
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.

qwe 07-11-2011 07:44 PM

Quote:

Originally Posted by potter (Post 18272186)
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 ?

CYF 07-11-2011 07:48 PM

Quote:

Originally Posted by qwe (Post 18275330)
anyway to do it in php 4 ?

php4 was obsolete in 2008. Time to upgrade.

amateurcanada 07-11-2011 08:05 PM

coders lol


All times are GMT -7. The time now is 04:07 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc