For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > December 2004 > Re: [SMARTY] way to get current URL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] way to get current URL
Monte Ohrt

2004-12-31, 3:59 pm

You could assign it how you like:

$smarty->assign('url', 'http://' . $_SERVER['SERVER_NAME'] .
$_SERVER['REQUEST_URI']);

or access server vars directly:

{$smarty.server.REQUEST_URI}

generic@SAFe-mail.net wrote:

>Hello--I would like to be able to get the current URL from within a Smarty template. I have looked at the reserved variables, but the {$smarty.get.page} and {$smarty.post.page} aren't what I need since a form has not been posted, only a php page executed

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com