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?
| SitePoint Sponsor |

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?
this will obviously not work if js is disabled or unavailable...Code:<a href="#" onclick="history.back()">go back</a>
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
For the most accessible workaround, a server-side language would be most helpful. See this PHP example:
Of course, if your user has a firewall program messing with referrers AND scripting disabled, you're still out of luck.PHP Code:<a href="<?php echo($_SERVER['HTTP_REFERER']);?>"
onclick="history.go(-1); return false;">
« Back</a>
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 digressOriginally Posted by vgarcia
![]()
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