D datrader New member Apr 10, 2011 22 0 0 Jul 9, 2012 #1 hi, i'd like to check the server headers (200/404/502) of an HTTPS page. how do i do that in PHP? the function get-headers doesn't support HTTPS. thanks guys!
hi, i'd like to check the server headers (200/404/502) of an HTTPS page. how do i do that in PHP? the function get-headers doesn't support HTTPS. thanks guys!
Rage9 Banned Jan 7, 2008 6,062 101 0 Jul 9, 2012 #2 Google? You ever hear of it? Use cURL: Code: $ch = curl_init('http://yoururl/'); curl_setopt($ch, CURLOPT_HEADER, 1); $c = curl_exec($ch); echo curl_getinfo($ch, CURLINFO_HTTP_CODE); This will return the status code only, 200, 404, etc... If you want the entire header see here: Header only retrieval in php via curl - Stack Overflow
Google? You ever hear of it? Use cURL: Code: $ch = curl_init('http://yoururl/'); curl_setopt($ch, CURLOPT_HEADER, 1); $c = curl_exec($ch); echo curl_getinfo($ch, CURLINFO_HTTP_CODE); This will return the status code only, 200, 404, etc... If you want the entire header see here: Header only retrieval in php via curl - Stack Overflow
D datrader New member Apr 10, 2011 22 0 0 Jul 10, 2012 #3 thanks bro. Curl was the answer (i'm not familiar with it). thanks for the help! man i love this forum, all the pros in one place!
thanks bro. Curl was the answer (i'm not familiar with it). thanks for the help! man i love this forum, all the pros in one place!
A Adscend_Jeremy New member Oct 6, 2009 142 1 0 adscendmedia.com Jul 10, 2012 #4 Probably need to add this: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);