Results 1 to 10 of 29
-
17th Sep 2009, 10:15 PM #1OPMemberWebsite's:
zomgbbqpizza.com evilddl.com scenemarket.orgFastest Way To Check If A Site Is Up??
Hi, I have been playing around with an old auto submitter script.
I added a function to see if the sites in the list are online before submission, so they would be automatically unticked if they were not online:
This is the function i used:
Code:function Visit($url) { $agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";$ch=curl_init(); curl_setopt ($ch, CURLOPT_URL,$url ); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch,CURLOPT_VERBOSE,false); curl_setopt($ch, CURLOPT_TIMEOUT, 5); $page=curl_exec($ch); //echo curl_error($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if($httpcode>=200 && $httpcode<300) return true; else return false; }
DEViANCE Reviewed by DEViANCE on . Fastest Way To Check If A Site Is Up?? Hi, I have been playing around with an old auto submitter script. I added a function to see if the sites in the list are online before submission, so they would be automatically unticked if they were not online: http://www.besthostingforums.com/images/cdn/besthostingforums.com/2009/09/149.jpg This is the function i used: function Visit($url) { Rating: 5
-
17th Sep 2009, 10:41 PM #2Member
Probably takes a while because codemafia.org needs to timeout? Not sure you can make it any quicker at run time unless you set up a seperate task to check the sites every few minutes and store in a database then load that into the page?
-
17th Sep 2009, 10:46 PM #3OPMemberWebsite's:
zomgbbqpizza.com evilddl.com scenemarket.orgNope, i only put codemafia.org in thier as an example for my screen shot, even when all sites are up its taking at least like five seconds or maybe ten... pages should not take that long to load nomatter what your doing..??
The only thing i can think of (as im pretty sure this is one of the best methods) is learning AJAX so i can make the sites show up as they are resolved?? I am ok with php but not tried ajax yet so might take me awhile to understand it.
I really need a faster function, even if its just slightly faster...
-
17th Sep 2009, 10:47 PM #4BannedWebsite's:
Dev-Security.netFaster way can you can do it in less than 5 seconds
ping website.com
-
17th Sep 2009, 10:49 PM #5OPMemberWebsite's:
zomgbbqpizza.com evilddl.com scenemarket.org
-
17th Sep 2009, 10:51 PM #6Member
Assuming the host will respond to pings...
Maybe get_headers() - look for the 200 header - or file_get_contents() - look for something specific on the page; might be faster...
-
17th Sep 2009, 10:53 PM #7OPMemberWebsite's:
zomgbbqpizza.com evilddl.com scenemarket.org
-
17th Sep 2009, 10:58 PM #8BannedWebsite's:
Dev-Security.netIf a host has disabled pings that will cause a variety amounts of issues to the server
97.99+ % ping is never disabled and if need be just make a .bat script to ping it
-
17th Sep 2009, 11:00 PM #9MemberPHP Code:
$head = get_headers("the url you want to check", 1);
Code:Array ( [0] => HTTP/1.1 200 OK [Date] => Sat, 29 May 2004 12:28:14 GMT [Server] => Apache/1.3.27 (Unix) (Red-Hat/Linux) [Last-Modified] => Wed, 08 Jan 2003 23:11:55 GMT [ETag] => "3f80f-1b6-3e1cb03b" [Accept-Ranges] => bytes [Content-Length] => 438 [Connection] => close [Content-Type] => text/html )
PHP Code:if(strpos($head[0], "200") !== false){
// site is up
}else{
etc...
-
17th Sep 2009, 11:01 PM #10OPMemberWebsite's:
zomgbbqpizza.com evilddl.com scenemarket.org@william
I don't care about this ping thing unlerss you can provide a code example, sorry to be blunt but i want to get to the bottom of this and move forward, if you can't give me a code example your not good enough at php to help me in this thread.
Thanks bennelsworth, i will look into this.
Equal to or greater than 200 and less than 300 should work.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Fastest movie releases site?
By syd2oo2 in forum General DiscussionReplies: 23Last Post: 13th Nov 2011, 06:33 PM -
Cool Site To Check How Many Backlinks Your Site Has
By DJboutit in forum Useful SitesReplies: 6Last Post: 5th Oct 2011, 08:50 AM -
My site, Can you check?
By happyvalentine in forum Forum and DDL DiscussionReplies: 2Last Post: 5th Dec 2010, 12:04 PM -
Check Out My Site -
By TeRm!NaToR in forum Site ReviewsReplies: 2Last Post: 24th Aug 2009, 05:21 AM -
check your site value in $
By waqararif in forum General DiscussionReplies: 22Last Post: 8th Jul 2009, 09:23 AM
themaCreator - create posts from...
Version 3.53 released. Open older version (or...