Daniel | 7 Feb 17:21
Picon
Picon
Favicon

Previous Page

Hello,
I want to put something in my page like

"You are coming from {$PrevPage}"
(Where $PrevPage is the previous page)

so I put in config.php

$pagename = ResolvePageName($pagename);
if ($pagename != $prevpage) {
  $prevpage          = ResolvePageName($prevpage);
  $FmtPV['PrevPage'] = PageVar($prevpage, '$FullName');
  $prevpage          = $pagename;
}

(inspired by a recent post on this list)

But it doesn't work. Probably because I do not fully understand the
working of these functions -I cannot find any documentation.
Can someone help me here?

TIA, Daniel K
Peter Bowers | 7 Feb 17:51
Picon
Favicon

Re: Previous Page

On Tue, Feb 7, 2012 at 5:21 PM, Daniel <dkml <at> xs4all.nl> wrote:
> $pagename = ResolvePageName($pagename);
> if ($pagename != $prevpage) {
>  $prevpage          = ResolvePageName($prevpage);
>  $FmtPV['PrevPage'] = PageVar($prevpage, '$FullName');
>  $prevpage          = $pagename;
> }

You would have to save it in your session or a cookie rather than just
in a variable if you want the value to remain between successive loads
of pages.

All normal PHP variables are destroyed (lose their values) at the
conclusion of the processing of the current page.

-Peter
Daniel | 7 Feb 20:29
Picon
Picon
Favicon

Re: Previous Page

On 07-02-12 17:51, Peter Bowers wrote:
> On Tue, Feb 7, 2012 at 5:21 PM, Daniel <dkml <at> xs4all.nl> wrote:
>> $pagename = ResolvePageName($pagename);
>> if ($pagename != $prevpage) {
>>  $prevpage          = ResolvePageName($prevpage);
>>  $FmtPV['PrevPage'] = PageVar($prevpage, '$FullName');
>>  $prevpage          = $pagename;
>> }
> 
> You would have to save it in your session or a cookie rather than just
> in a variable if you want the value to remain between successive loads
> of pages.
> 
> All normal PHP variables are destroyed (lose their values) at the
> conclusion of the processing of the current page.

I think I found a solution using Cookbook/HttpVariables

Page A: (:cookie prev page_a:)
Page B: You are coming from {$@prev}

Thanks

Gmane