...

View Full Version : PHP - how to get headers of an HTTPS page?



zeemperor
07-09-2012, 01:25 PM
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!

Fou-Lu
07-09-2012, 03:01 PM
Use CURL instead, or sockets are always an option.
In CURL, you'll need to disable the peer verification for the SSL unless you go abouts providing it with some more SSL information.
There's actually an example on the curl_setopt page: http://ca.php.net/manual/en/function.curl-setopt.php
Just search for "HTTPS" until you get to user examples. A few in there's one that shows what headers to send for https requests for a head.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum