Back button link and Forward Button Link

Posted on 2007-10-05
Last Modified: 2010-04-09
Hi guys!
Hope you are well.
What Id like to do on a page is to create 2 links.
The first would be a Back link, so for example, whatever page

Curent Page = A
Go to Page = B
On Page B, if I click on an image that says "Back", it takes me back to Page A.
So, if my history of pages that I visited was:
Page A ----> Page B ----> Page C----->   Page D
If Im on Page D, if I keep clicking on Back, it takes me to Page C, then B, then A.

Same logic but in reverse for a Forward Button link.

Any help greatly appreicated.
Question by:Simon336697
    LVL 5

    Accepted Solution

    Use JavaScript's history function:

    <a href="javascript:history.go(-1)">Back</a>

    You can set -1 to some other value
    LVL 1

    Author Comment

    Hey frin :>)
    Thank you ! you are sooo fast :>)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now