HTTP or HTTPS

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gwnterprises
Forum Newbie
Posts: 5
Joined: Sun Jul 26, 2009 1:30 pm

HTTP or HTTPS

Post 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 :)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: HTTP or HTTPS

Post by alex.barylski »

gwnterprises
Forum Newbie
Posts: 5
Joined: Sun Jul 26, 2009 1:30 pm

Re: HTTP or HTTPS

Post by gwnterprises »

Thank you! I'll check it out.
gwnterprises
Forum Newbie
Posts: 5
Joined: Sun Jul 26, 2009 1:30 pm

Re: HTTP or HTTPS

Post 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
Post Reply