SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Zealot Blunderboy's Avatar
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    linking back to last page visited

    Hi ye mighty web sages. Can someone be so kind as to tell me the code to slap on a link that will take the visitor back to the page they came from?

  2. #2
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <a href="#" onclick="history.back()">go back</a>
    this will obviously not work if js is disabled or unavailable...
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    For the most accessible workaround, a server-side language would be most helpful. See this PHP example:
    PHP Code:
    <a href="<?php echo($_SERVER['HTTP_REFERER']);?>"
    onclick="history.go(-1); return false;">
    &laquo; Back</a>
    Of course, if your user has a firewall program messing with referrers AND scripting disabled, you're still out of luck.

  4. #4
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia
    Of course, if your user has a firewall program messing with referrers AND scripting disabled, you're still out of luck.
    then you'd have to start using sessions and creating your own "history" for each user...which is quite taxing depending on traffic...but we digress
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •