http or https - is there a _SERVER var for this?

    Date: 06/13/07 (PHP Community)    Keywords: php, apache

    Not sure if this goes here or in apache..

    Is there a $_SERVER variable for protocol?

    edited
    Sorry, RTFM and found that protocol is available via $_SERVER['SERVER_PROTOCOL'] in php 4.1 and above.. BUT that returns HTTP/1.1 regarless of HTTP or HTTPS.

    So to check for HTTPS KernelM suggests using $_SERVER['HTTPS'], and look for an empty value for HTTP or 'on' for HTTPS. (works perfectly) Thanks! :o)

    Source: http://community.livejournal.com/php/572033.html

« Weird characters || MySQL password management »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home