SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: grab URL as string
-
Jul 24, 2001, 20:02 #1
- Join Date
- Feb 2001
- Location
- Canada
- Posts
- 23
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
grab URL as string
How does one get the entire URL, I'm particularly interested
in getting the http and/or https.... am I going about this wrong... I need to find a way to detect if the current page
is in use is using SSL or not
Thank you in advance
-
Jul 24, 2001, 21:57 #2
- Join Date
- Jun 2000
- Location
- Sydney, Australia
- Posts
- 3,798
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The parse_url function may be of use to you. I only stumbled upon it the other day by accident.
http://php.net/manual/en/function.parse-url.php
-
Jul 25, 2001, 08:01 #3
- Join Date
- Aug 1999
- Location
- Pittsburgh, PA, USA
- Posts
- 3,910
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Nice one, Sid -- definitely useful. If for whatever reason you don't want to use it, you can try something like this:
PHP Code:<?php
$url = "http://www.yahoo.com";
if (strpos($url, "s") == 4) {
print "Secure";
} else {
print "Not Secure";
}
?>
Bookmarks