Gossamer Forum
Home : General : Internet Technologies :

Using Current URL

Quote Reply
Using Current URL
Is there an $_ENV or $_SERVER variable that holds the CURRENT URL of a site? It want to test whether the site is secure by seeing if the URL starts with http: or https:.

In the alternative, is there another way to test to see if your site is currently using SSL?

Thanks.
Quote Reply
Re: [Lee] Using Current URL In reply to
Hi Lee,

Yes, there is. You can check with the HTTPS variable , i.e. $_SERVER['HTTPS']

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] Using Current URL In reply to
You sure? I found that when accessing a PHP variable from HTTPS, a lot of these variables are not available Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Lee] Using Current URL In reply to
$_SERVER['HTTPS'] is sometimes available and sometimes not.

You could also check what port the visitor is on by using $_SERVER['SERVER_PORT']. Usually 443 is the SSL port and 80 is the regular http port.

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund