Absence of back button in extended article

Asked by Gareth Dale

I have a news page which displays 5 news articles on a page and they each display the main article text as a summary. When a user clicks on the title link they see the summary plus the extended article. This is fine, but there is no option for a back button/link from that article to which ever page they were previously on. If they were on page 12, I don't want them to have to go through the pages from page 1 as what happens at the moment. Is there any php code that can help me out with this?

Question information

Language:
English Edit question
Status:
Answered
For:
phpns Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ravens (ravensd) said :
#1

Might you can place this?! in the template..

<a href="#" onClick="history.go(-1)">Back</a>
<input type=button value="Back" onClick="history.go(-1)">

Change the value of -1 to any number of pages you would like to send your visitors back

Dunno.. Im new to phpns :)

Revision history for this message
Gareth Dale (webmaster-westbuckland) said :
#2

I'd already tried that when I first encountered the problem and no it doesn't work with the way php works. The browser history does not record what is happening with the php script on the remote server.

Revision history for this message
alecwh (alecwh) said :
#3

There isn't a way to do this, beside Raven's contribution. This solution should, seemingly, work fine in most modern browsers.

Can you help with this problem?

Provide an answer of your own, or ask Gareth Dale for more information if necessary.

To post a message you must log in.