PDA

View Full Version : How to create a back button


Ann
05-24-2005, 02:29 PM
Hi,

I've created a button (in Dreamweaver) that lets a browser say whether they like an image or not. With a cgi script so I receive an email that says like it or dislike it.

I'd like to be able to thank commenting browsers and then return them to the original image page by way of a navigation 'back' button in dreamweaver. Can I use one thankyou page with some kind of historic 'back' feature. I don't want to have to create individual thankyou pages for each individual image page.

Can anyone suggest a way of doing this?

http://www.ann-dadd-designs.co.uk ('http://www.ann-dadd-designs.co.uk')


Also any comments on the site would be appreciated......
Thankyou,
Ann.

ranjan
05-24-2005, 11:24 PM
There is no easy solution to what you want to achieve. There is a learning process involved to get it done.... If you want to learn, below are the basics that should get you started.

dynamic web sites are built on the fundamental principal of maintaining state. there are several ways of maintaining state:

1. with help of query strings you can pass variables from one web page to another
eg. your like / dislike button could pass pass the variables
a. user=likes or user=dislikes
b. image=3 (image number)
to a thank you page. the thanks page can then redirect the user to image number

2. cookies can be used to store data on a users machine which can then be used by other pages on your website. just another way of maintaining state
eg. your thanks page stores if the person has already voted his/her likes for the given image. if he/she has then he/she isn't allowed to vote again using conditional statements.

3. sessions (search google for more details)

You can google for terms like "maintian state cgi" or "querystrings" or "cookies cgi" or "sessions cgi" for more reads on the subject.

Or you could just hire a developer (shameless plug) to build you a voting system

Sloth_Boy
05-25-2005, 01:33 AM
This may help

Put this as a link:

javascript:history.go(-1)

that takes the user back to the previous page he viewed.

ranjan
05-25-2005, 08:36 AM
This may help

Put this as a link:

javascript:history.go(-1)

that takes the user back to the previous page he viewed.
Lets say I come from a google search page directly to the thanks page.

The javascript code will take me back to google when i click on the link....

Is that the desired result?