I want to provide a simple 'back' link because im using one script to display multiple pages, but im not sure what the best way to do it is..

i ran across this <a href = "javascript:history.back()"> Go back </a>

but obviously, if the user has javascript disabled, this won't work. is there a more reliable way to do a back function? thanks

    personally, i would just have some text telling the user to use thier back button. thats what its for, i dont really see the need to reinvent the wheel here.

    but if you must...
    my first choice would be to use javascript. im sure you have heard of the <noscript> tag. use it to display a message saying "use your back button" to those who have js disabled.

    if you dont want to do that, and you want to be able to provide a link to ALL users no matter what, the only reliable way is to keep track of the last page the user has viewed.

    you could
    a) use sessions to store the last page viewed and the use that value to form a link for them to click.
    b) instead of using sessions, pass the previous page in the url.
    eg:
    foo.php?prev=path/to/bar.php

      the noscript tag sounds good, ill look into it. thanks much

        Write a Reply...