Re: Compiled template path
| From: | Raul Carvalho | Date: | Wed, 23 Jul 2003 07:34:01 +0000 |
| Subject: | Re: Compiled template path | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-9945@lists.php.net to get a copy of this message | ||
Hello Tom,
Thank you for your answer.
I don't see a easy way to remove GET+POST info using display()... But
that's just me :-)
IMHO if the script doesn't change, the info will be kept at client side.
It seems to me the only way to force a browser to forget GET+POST info is
to redirect it to another page, thus without propagating this info.
I have acomplished a simple method, but probably more eficient than
redirecting to the compiled template:
1 - $smarty->fetch()
2 - generate a random file name with md5(rand())
3 - write the fetched info to the file
4 - redirect browser to file
5 - the main script will check for random files older than one minute an
delete them
This method is working very well for me, although I must agree there may be
a better solution.
I'd like to discuss an example of extending display(), can you dig your
idea a bit more?
Thank you!
Raul
> Raul Carvalho wrote:
> > Hello,
> >
> > I'd like to know if it is possible to get the full path of a compiled
> > template, or at least the path relative do webserver root.
> >
> > The reason I need this for is to have the browser redirect to that file
> > instead of using $smarty->display($tpl).
> >
> > This method would allow the scripts to remove all POST+GET information,
> > thus preventing users from trashing the database with browser refreshs.
>
> Use display() .. Any other method is a bad idea...
>
> You can extend display() to include a script which cleans the GET and
> POST variables
>
> See documentation
>
> --
> Tom Sommer, Denmark
> www.dreamcoder.dk - www.tsn.dk - http://blog.dreamcoder.dk