Page 1 of 1

Embarrassing Question

Posted: Sat Dec 09, 2006 8:41 pm
by swathes
I know its prob really easy, but having mental block...  How do I print the url of the current page...?

Re: Embarrassing Question

Posted: Sat Dec 09, 2006 9:21 pm
by jmcgin51
interesting - I would have thought there would be a Tag for that, but I don't see one...  looks like you'll have to create a User-Defined Tag.  Maybe this tag can be incorporated into the core for the next release...

Re: Embarrassing Question

Posted: Sat Dec 09, 2006 9:31 pm
by petert

Code: Select all

<?php
echo $_SERVER['SCRIPT_NAME']
?> 
and here is the same subject:
http://forum.cmsmadesimple.org/index.ph ... w.html#new

Re: Embarrassing Question

Posted: Sun Dec 10, 2006 7:46 pm
by swathes
echoing the Script name just gave me /index.php.... :(

Re: Embarrassing Question

Posted: Sun Dec 10, 2006 7:58 pm
by Dee
midnightmind recently posted a url to this article which may help you.

Re: Embarrassing Question

Posted: Mon Dec 11, 2006 2:16 am
by jmcgin51
I'm confused - do I just copy and paste the script from that page into my user-defined tag?  If that's what I'm supposed to do, it doesn't work...

Re: Embarrassing Question

Posted: Mon Dec 11, 2006 2:26 am
by Dee
The script creates a variable $_SERVER['FULL_URL']. You'll probably want to

Code: Select all

echo $_SERVER['FULL_URL']
at the end if you use it in a UDT.