473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

PHP equivalent to javascript window history?

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

Thanks!

Larry
Jul 17 '05 #1
4 3843
Larry Kahm wrote:
Is there a PHP equivalent to the javascript statement history.go(-1)?


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/
Jul 17 '05 #2
"Larry Kahm" <lkahm@nospam_bellatlantic.net> wrote in message
news:8UTfd.11195$PZ4.7264@trndny07...
Is there a PHP equivalent to the javascript statement history.go(-1)?

Thanks!

Larry


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.
Jul 17 '05 #3
rw
OO Command pattern i think.
rw
Larry Kahm wrote:
Is there a PHP equivalent to the javascript statement history.go(-1)?

Thanks!

Larry

Jul 17 '05 #4
>>>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" <bl*******@electrictoolbox.com> wrote in message
news:10**************@216.128.74.129...
Larry Kahm wrote:
Is there a PHP equivalent to the javascript statement history.go(-1)?


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/
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Peter Bremer | last post by:
Hi all, I've written this little piece of code, which doesn't seem to work in Mozilla 1.5. I haven't tried it on other Gecko browsers, but I've found some indication that Netscape 6+ has the...
2
by: Nicki Pittman | last post by:
I have a web-based application that contains page with a form to allow a user to edit their account information (i.e. address, phone, email, etc.). This form is being pre-populated through XSLT...
5
by: TrvlOrm | last post by:
Can any one please help me...I am new to JavaScript and I have been struggling with this code for days now and can't figure it out. I would like to get the Buttons to correspond with the action...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
3
by: Jake | last post by:
Im using some custom javascript:history.forward() & javascript:history.back() image buttons on my application. If there is no back or forward history, I would like to display a dimmed(disabled...
8
by: Alex D. | last post by:
does any body knows how to open a new IE window and close the favorites tab and history tab (if tabs enabled)? problem is that when opening new windows(pop-ups) with absolute size and the user has...
4
by: fredd00 | last post by:
Hi I have an aspx page that has a datagrid and a print button i have a javascript function : function PrintPage(){ if (window.print) {alert('print');window.focus(); window.print(); }...
3
by: anthonybrough | last post by:
I have an asp page that has a form to collect user data in a form. when the user clicks submit the input is validated. If any fields are not acceptable the user clicks on a button to go back to...
1
by: George | last post by:
Dear All, I am trying to write a simple script that prints out all the URLs in the history of the current window. I wrote this code: <html> <head> <title>Example Page</title> <script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.