Activity Stream
48,167 MEMBERS
63783 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 3 123 LastLast
Results 1 to 10 of 29
  1.     
    #1
    Member
    Website's:
    zomgbbqpizza.com evilddl.com scenemarket.org

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



    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;
    
    }
    But it takes a very long time to load even with just ten or so sites using this method.. Is there any faster way to do this???
    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

  2.   Sponsored Links

  3.     
    #2
    Member
    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?

  4.     
    #3
    Member
    Website's:
    zomgbbqpizza.com evilddl.com scenemarket.org
    Nope, 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...

  5.     
    #4
    Banned
    Website's:
    Dev-Security.net
    Faster way can you can do it in less than 5 seconds

    ping website.com


  6.     
    #5
    Member
    Website's:
    zomgbbqpizza.com evilddl.com scenemarket.org
    You have php code example of this??

  7.     
    #6
    Member
    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...

  8.     
    #7
    Member
    Website's:
    zomgbbqpizza.com evilddl.com scenemarket.org
    Can you give me an example of the get headers method? I don't think file get contents is good at all, will surely take loads longer...??

  9.     
    #8
    Banned
    Website's:
    Dev-Security.net
    If 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

  10.     
    #9
    Member
    PHP Code: 
    $head get_headers("the url you want to check"1); 
    $head is then an array, for example:
    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
    )
    You could then check it in many different ways...
    PHP Code: 
    if(strpos($head[0], "200") !== false){
        
    // site is up
    }else{
    etc... 
    Reason I did that rather than simple == check is because they won't always have the same response. Maybe HTTP1.0 instead etc...

  11.     
    #10
    Member
    Website'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.

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Fastest movie releases site?
    By syd2oo2 in forum General Discussion
    Replies: 23
    Last Post: 13th Nov 2011, 06:33 PM
  2. Cool Site To Check How Many Backlinks Your Site Has
    By DJboutit in forum Useful Sites
    Replies: 6
    Last Post: 5th Oct 2011, 08:50 AM
  3. My site, Can you check?
    By happyvalentine in forum Forum and DDL Discussion
    Replies: 2
    Last Post: 5th Dec 2010, 12:04 PM
  4. Check Out My Site -
    By TeRm!NaToR in forum Site Reviews
    Replies: 2
    Last Post: 24th Aug 2009, 05:21 AM
  5. check your site value in $
    By waqararif in forum General Discussion
    Replies: 22
    Last Post: 8th Jul 2009, 09:23 AM

Tags for this Thread

BE SOCIAL