Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP - how to get headers of an HTTPS page?

    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!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •