angelsRock Posted October 25, 2007 Share Posted October 25, 2007 hi.. i use backspace to link back to my previous page.. but it fails me ...showing webpage has expired .. what should i do?? Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/ Share on other sites More sharing options...
pocobueno1388 Posted October 25, 2007 Share Posted October 25, 2007 How to you use "backspace" to link back to your previous page? Your going to have to explain more, and maybe give us some code to look at. Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/#findComment-377505 Share on other sites More sharing options...
unidox Posted October 25, 2007 Share Posted October 25, 2007 Use $_SERVER['PHP_SELF'] It goes to the previous viewed page. Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/#findComment-377506 Share on other sites More sharing options...
pocobueno1388 Posted October 25, 2007 Share Posted October 25, 2007 Use $_SERVER['PHP_SELF'] It goes to the previous viewed page. No, thats wrong. $_SERVER['HTTP_REFERER'] will give you the last page. Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/#findComment-377508 Share on other sites More sharing options...
unidox Posted October 25, 2007 Share Posted October 25, 2007 My bad Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/#findComment-377512 Share on other sites More sharing options...
angelsRock Posted October 25, 2007 Author Share Posted October 25, 2007 where should i put that $_SERVER['HTTP_REFERER'] ? into the previous page? or current page? where thanks Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/#findComment-377513 Share on other sites More sharing options...
pocobueno1388 Posted October 25, 2007 Share Posted October 25, 2007 If you want to link to the previous page, do this <?php echo "<a href='{$_SERVER['HTTP_REFERER']}'>Previous Page</a>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/#findComment-377516 Share on other sites More sharing options...
angelsRock Posted October 25, 2007 Author Share Posted October 25, 2007 oh .. actually i don want to put any link for them... .. can they just use the backspace to go back? Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/#findComment-377521 Share on other sites More sharing options...
pocobueno1388 Posted October 25, 2007 Share Posted October 25, 2007 They could, if there browser supports that. I'm not sure if there are any that don't. For a good web page, I would put a back button if it's necessary. Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/#findComment-377525 Share on other sites More sharing options...
PHP_PhREEEk Posted October 25, 2007 Share Posted October 25, 2007 The backspace is a browser function. PHP cannot map keyboard functions on the client side. If your website is coming up expired when going back, then a POST or GET must have been used to get to that page to begin with. You should get additional error text that says click ok to resend data or similar. There is no workaround other than a hard 'Previous' link. Lastly, a META tag may be causing the page to expire, so check that they are all correct. PhREEEk Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/#findComment-377533 Share on other sites More sharing options...
darkfreaks Posted October 25, 2007 Share Posted October 25, 2007 you can use javascript to form a previous link as well <a href="#" onClick="history.go(-1)">Previous</a> Quote Link to comment https://forums.phpfreaks.com/topic/74675-solved-using-bakspace-cannot-link-back-to-previous-page/#findComment-377539 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.