COLORADO: 4:07 am
JAPAN: 7:07 pm

-1097 days for S+Y!

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: PHP :: check to see if a website is up or down
PostPosted: Wed Jul 10, 2013 3:01 pm 
User avatar

Joined: Sun Nov 08, 2009 7:03 pm
Posts: 1548
Location: Colorado

// make sure site is up
//  more code at
// uncomment to show errors
// error_reporting(-1);

// set the URL
           $cl = curl_init($url);
           curl_setopt($cl,CURLOPT_CONNECTTIMEOUT, 2);
           curl_setopt($cl, CURLOPT_TIMEOUT, 3);
           //get response
           $response = curl_exec($cl);
           if ($response) echo 'site up';
        else   echo 'site down';

Contact me directly: Ironfeatherbooks (@)


Bookmark and Share

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest

Search for:

This site contains adult natured content. All material submitted to this site is the sole responsibility of the submitter.

© 2023 Iron Feather Journal


Recent Visitors: