[SOLVED] getting the adress br url

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
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

[SOLVED] getting the adress br url

Post 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?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Have a look at functions like:
[php_man]dirname[/php_man]()
[php_man]pathinfo[/php_man]()

Mac
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

those 2 are not good

Post 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!
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Then have a look at:
[php_man]parse_url[/php_man]()

Mac
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

still thi is a manipultaion function

Post 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?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Perhaps:

Code: Select all

echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
User avatar
pelegk2
Forum Regular
Posts: 633
Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:

thanks

Post by pelegk2 »

execlly what i was looking for :D
Post Reply