I am designing a website with several pages that are sequentially numbered, i.e., 0001.html, 0002.html, etc.
I'd like to be able to put a <right arrow> button on each page, which when clicked, will send the user to the next sequential page.
Is there a way to use a variable in the link, i.e., http://www.myweb.com/000n.html, and define the click on the button to make n=n+1?
In other words, if someone is looking at 0001.html and clicks the <right arrow>, 0002.html should load.
At the risk of being too annoying, I'd also like some sort of onerr command so that if the value of n exceeds the maximum number of pages and returns a 404, the user will be sent back to the main menu.
I'm told this should be done in php, but I haven't a clue where to start.
I'd appreciate any help.