Jump to content

$_SERVER help


tcorbeil

Recommended Posts

Me again...

 

is there a way to get just the url?

 

for instance if I have an address such as Domain Name/Oilers/oilers.html

 

in every instance I do $path = $_SERVER['SCRIPT_NAME']; I get /Oilers/oilers.html

 

If i just want /Oilers/ with the file running name at the end, how would I go about?

 

Thanks.

T.

Link to comment
https://forums.phpfreaks.com/topic/43699-_server-help/
Share on other sites

Thanks Frost.

 

I tried print_r($_SERVER); and seen all of the info.. none of the switch variable would give the path without the file running at the end.. can you elaborated on the split idea? Could I also not use a rtrim up until the first '/' it encounters?

 

Thanks. T

 

Link to comment
https://forums.phpfreaks.com/topic/43699-_server-help/#findComment-212153
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.