Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

"Go Back" whilst adding SESSION VARIABLE?

Contributor ,
Jun 06, 2009 Jun 06, 2009

Is it possible to add a SESSION VARIABLE at the same time as one operates a "Go Back" link?
My site covers information for three towns. The names of the towns are the possible SESSION VARIABLES. In the absense of a SESSION VARIABLE I plan to divert to a page where the user selects a town form the list of three links. I am trying to make this link add the selected town-name as a SESSION VARIABLE and also operate the "Go Back" link so that the target page now receives a SESSION VARIABLE.
I tend to use php and in this case I am making use of a Go Back javascript, but cannot work out quite how to make it work, or if it is possible.

I'm using DWmx2004.

TOPICS
Server side applications
762
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 06, 2009 Jun 06, 2009

The JavaScript "go back" operates client-side (i.e., solely in the browser). Creating a session variable needs to be done by PHP, which is a server-side language. You can't do it without submitting something to the server to create the session variable.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 06, 2009 Jun 06, 2009

You can use javascript to save info on a cookie and use go back button. Then you can use the info from the cookie to write to session variable on the page you went back to. Depending on what you're doing there may be security issues involved using this method.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 06, 2009 Jun 06, 2009

Thanks for the ideas.

DWFAQ.info wrote:

You can use javascript to save info on a cookie and use go back button. Then you can use the info from the cookie to write to session variable on the page you went back to. Depending on what you're doing there may be security issues involved using this method.

That sounds interesting. Security is not an issue here, but I've not used cookies before. Could you either explain how that would be done, or point me to an explanation (and example) somewhere, please?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jun 07, 2009 Jun 07, 2009
LATEST

The methods involved are beyond the scope of this discussion but the terms mentioned should be enough to search and find a solution on your own accord.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines