Page 1 of 1

HTTP or HTTPS

Posted: Sun Jul 26, 2009 2:49 pm
by gwnterprises
Hello,

I'm a bit new at PHP so please be patient. Thanks

I need to get the "full" url of any given web page from my website, (it must be the complete url)
example: [http://mysite.com/directory/document.extension]
and assign that URL value to a variable.

I've tried (locally) the values of HTTP_REFERER, PHP_SELF, REQUEST_URI, and several others and the best I come up with is:
mysite.com/directory/document.extension, etc..., but as you can see the URL is missing the [http://] part, which happens to be what I'm after.

I need to determine the connection. Is it:
http or https ?

Once the type of connection has been determined, then the rest of my code will work.

Thanks :)

Re: HTTP or HTTPS

Posted: Sun Jul 26, 2009 2:52 pm
by alex.barylski

Re: HTTP or HTTPS

Posted: Sun Jul 26, 2009 3:13 pm
by gwnterprises
Thank you! I'll check it out.

Re: HTTP or HTTPS

Posted: Sun Jul 26, 2009 6:02 pm
by gwnterprises
Just wanted to add to my last post that I was doing the right thing all this time, just didn't go far enough.

Thanks again for the help! :D