Re: back functionality

2007-09-01 Thread [EMAIL PROTECTED]

Technically the referrer header is an optional part of the http spec,
so cannot always be relied upon (though most browsers do behave, you
may get issues with odd proxies misbehaving). The only really reliable
way to do this is to tag the previous page in your session (best in a
beforeFilter / afterRender) and use that. But yeah, for the majority
of circumstances Chris's method would work fine.

Simon

On Sep 1, 2:27 am, Chris Hartjes [EMAIL PROTECTED] wrote:
 On 8/31/07, rtanz [EMAIL PROTECTED] wrote:



  hi i would like to make a back button on some pages, how can i know
  the url of the previous page? thanks

 If you're in the controller, you can get the previous page via
 $this-referer().  I use it all the time to send people back to the
 page they were on before

 $this-redirect($this-referer());

 --
 Chris Hartjes
 Senior Developer
 Cake Development Corporation

 My motto for 2007:  Just build it, damnit!

 @TheBallpark -http://www.littlehart.net/attheballpark
 @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: back functionality

2007-09-01 Thread Chris Hartjes

On 9/1/07, Geoff Ford [EMAIL PROTECTED] wrote:

 To get around the referer issue you can use javascript and have Chris'
 method as a fallback.

 history.go(-1);

Geoff, that's a good idea.  Since I'm just getting into the swing of
things with Javascript that never occurred to me. :)

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  Just build it, damnit!

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



back functionality

2007-08-31 Thread rtanz

hi i would like to make a back button on some pages, how can i know
the url of the previous page? thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: back functionality

2007-08-31 Thread [EMAIL PROTECTED]

store the previous page in a session and use that to make the link, or
use the javascript history object.


On Sep 1, 12:26 am, rtanz [EMAIL PROTECTED] wrote:
 hi i would like to make a back button on some pages, how can i know
 the url of the previous page? thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: back functionality

2007-08-31 Thread Chris Hartjes

On 8/31/07, rtanz [EMAIL PROTECTED] wrote:

 hi i would like to make a back button on some pages, how can i know
 the url of the previous page? thanks

If you're in the controller, you can get the previous page via
$this-referer().  I use it all the time to send people back to the
page they were on before

$this-redirect($this-referer());

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  Just build it, damnit!

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---