URL commands
Posted: Thu Jun 03, 2004 6:05 am
Hi there
I want to get the full URL details of the current page with parse_url.
Currently I do the following:
Which outputs:
User:
Password:
Domain: http://www.mydomain.com
Query String: id=1234
Fragment:
How can I add the Username, password and Fragment parts to $urlString
if my url is of the form:
http://username:password@www.mydomain.c ... sting%this
??
Regards
swartbees
I want to get the full URL details of the current page with parse_url.
Currently I do the following:
Code: Select all
<?Php
$urlString = "http://{$_SERVERї'HTTP_HOST']}{$_SERVERї'PHP_SELF']}?{$_SERVERї'QUERY_STRING']}";
$urlArray = parse_url($urlString);
echo "User: " . $urlArrayї"user"] . "<br>";
echo "Password: " . $urlArrayї"pass"] . "<br>";
echo "Domain: " . $urlArrayї"host"] . "<br>";
echo "Query String: " . $urlArrayї"query"] . "<br>";
echo "Fragment: " . $urlArrayї"fragment"] . "<br>";
?>User:
Password:
Domain: http://www.mydomain.com
Query String: id=1234
Fragment:
How can I add the Username, password and Fragment parts to $urlString
if my url is of the form:
http://username:password@www.mydomain.c ... sting%this
??
Regards
swartbees