Connecting Tech Pros Worldwide Help | Site Map

PHP equivalent to javascript window history?

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 09:20 AM
Larry Kahm
Guest
 
Posts: n/a
Default PHP equivalent to javascript window history?

Is there a PHP equivalent to the javascript statement history.go(-1)?

Thanks!

Larry



  #2  
Old July 17th, 2005, 09:20 AM
Chris Hope
Guest
 
Posts: n/a
Default Re: PHP equivalent to javascript window history?

Larry Kahm wrote:
[color=blue]
> Is there a PHP equivalent to the javascript statement history.go(-1)?[/color]

No! PHP is server-sided so has no concept whatsoever of the browser's
history.

The closest you can get to it is using $_SERVER['HTTP_REFERER'] but this is
extremely unreliable as it is often blocked by the user. The other problem
is that going "back" using this method is really forward as far as the
browser is concerned, so after using it the first time you would just keep
toggling back and forward between the same two pages.

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
  #3  
Old July 17th, 2005, 09:20 AM
Chung Leong
Guest
 
Posts: n/a
Default Re: PHP equivalent to javascript window history?

"Larry Kahm" <lkahm@nospam_bellatlantic.net> wrote in message
news:8UTfd.11195$PZ4.7264@trndny07...[color=blue]
> Is there a PHP equivalent to the javascript statement history.go(-1)?
>
> Thanks!
>
> Larry
>[/color]

Nope. But it's easy enough to implement something like that yourself by
pushing the current URL into a session array in some globally included file.


  #4  
Old July 17th, 2005, 09:20 AM
rw
Guest
 
Posts: n/a
Default Re: PHP equivalent to javascript window history?

OO Command pattern i think.
rw
Larry Kahm wrote:[color=blue]
> Is there a PHP equivalent to the javascript statement history.go(-1)?
>
> Thanks!
>
> Larry
>
>[/color]
  #5  
Old July 17th, 2005, 09:20 AM
Larry Kahm
Guest
 
Posts: n/a
Default Re: PHP equivalent to javascript window history?

>>>No! PHP is server-sided so has no concept whatsoever of the browser's
history.

D'OH! - I've read it before. Now I get it!

Thanks!

Larry

"Chris Hope" <blackhole@electrictoolbox.com> wrote in message
news:1098910838_51291@216.128.74.129...
Larry Kahm wrote:
[color=blue]
> Is there a PHP equivalent to the javascript statement history.go(-1)?[/color]

No! PHP is server-sided so has no concept whatsoever of the browser's
history.

The closest you can get to it is using $_SERVER['HTTP_REFERER'] but this is
extremely unreliable as it is often blocked by the user. The other problem
is that going "back" using this method is really forward as far as the
browser is concerned, so after using it the first time you would just keep
toggling back and forward between the same two pages.

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.