Page 1 of 1
[SOLVED] getting the adress br url
Posted: Thu Dec 04, 2003 1:56 am
by pelegk2
when i go to a subfolder on my serer
i have a default page whuch isnt shown in the adress bar like this :
http://localhost/marketing
when i want to read this url on the server using : $PHP_SELF
i get the full path including the file name that isnt show in the adress bar!
how can i get the adress that is written in the adress bar?
Posted: Thu Dec 04, 2003 2:55 am
by twigletmac
Have a look at functions like:
[php_man]dirname[/php_man]()
[php_man]pathinfo[/php_man]()
Mac
those 2 are not good
Posted: Thu Dec 04, 2003 3:07 am
by pelegk2
beacuse they make manipulations on the url and that's now what i want!
what i want is to know what the "visible" url tht was written in the user
url and not the actual 1 (beacuse the actual 1 include's "/index.php"
which is the default but not sen in the url!
Posted: Thu Dec 04, 2003 3:20 am
by twigletmac
Then have a look at:
[php_man]parse_url[/php_man]()
Mac
still thi is a manipultaion function
Posted: Thu Dec 04, 2003 6:14 am
by pelegk2
it takes a url that u give not what on the clients screen!
on the client screen is :
http://localhost
and the php server see's
http://localhost/index.php
what to do?
Posted: Thu Dec 04, 2003 8:55 am
by JAM
Perhaps:
Code: Select all
echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
thanks
Posted: Thu Dec 04, 2003 9:18 am
by pelegk2
execlly what i was looking for
