PDA

View Full Version : How to echo the URL on the page?


Cybertims
03-30-2010, 07:53 AM
How can I show the URL of the page you are on somewhere on the page?

I run a forum with multiple domains and want to echo which domain each user is using on the page for them to see.

Cheers

Cybertims
03-31-2010, 10:50 AM
anyone?

Cybertims
04-04-2010, 09:54 AM
Even telling me it is impossible would help FFS......

Cybertims
04-06-2010, 07:31 AM
excellent support....

TigerC10
04-06-2010, 07:55 AM
In your AdminCP open up your style and go to edit templates. Put the following text in there where you want it to display:

http://$_SERVER['SERVER_NAME']$_SERVER['REQUEST_URI']


That should work. I would think it works. You know the word "echo" so it seems odd that you wouldn't have tried this already - but you didn't say you tried anything.

One thing you may need to be aware of is if you use mod_rewrite... Things make look a little funny.

Cybertims
04-06-2010, 08:31 AM
In your AdminCP open up your style and go to edit templates. Put the following text in there where you want it to display:

http://$_SERVER['SERVER_NAME']$_SERVER['REQUEST_URI']


That should work. I would think it works. You know the word "echo" so it seems odd that you wouldn't have tried this already - but you didn't say you tried anything.

One thing you may need to be aware of is if you use mod_rewrite... Things make look a little funny.Thanks mate, just tried that but it shows on the page as exactly that, no parsing of any kind, unless I've missed something?

I know very little about coding at all, or I would have tried to help myself :-)

Cheers for trying anyway.

TigerC10
04-06-2010, 08:40 AM
Oh! Sorry, that was my mistake. I was using the old 3.x standard. Use this instead:

http://{vb:raw $_SERVER['SERVER_NAME']}{vb:raw $_SERVER['REQUEST_URI']}


Just tested, it worked fine for me.

Cybertims
04-06-2010, 08:57 AM
Oh! Sorry, that was my mistake. I was using the old 3.x standard. Use this instead:

http://{vb:raw $_SERVER['SERVER_NAME']}{vb:raw $_SERVER['REQUEST_URI']}


Just tested, it worked fine for me.Now that is what I call working!

Cheers fella, cyber pint to you if there is such a thing :D

Many Thanks for your help.

TigerC10
04-06-2010, 09:02 AM
Glad to help. Kinda surprised it took this long for you to get a response about it, though. C'est la vie, no?