Link to home
Start Free TrialLog in
Avatar of Dada44
Dada44Flag for Spain

asked on

Navigating to contiguous pages

Dear people,

I have a mysql table named questions with two fields. One field is called question and the other keyword. So far I have 3 questions in there:
Keyword - question
Colour  whats your favourite colour?
Age- hold old are you?
Name  whats your name?

I have 3 php pages called page_colour.php, page_age.php and page_name.php
In each of these pages I would like to have an arrow to the left and an arrow to the right in order to navigate to the pages that are not the one Im viewing & 
How can I do that?? I am lost :(

Thanks a lot in advance!
Avatar of mespinozae
Flag of Costa Rica image

sounds a lot like you are seeking a simple link in html... something like

<a href="page_colour.php> Previous </a>
This page: page_age.php
<a href="page_name.php"> Next </a>

If this is not it, maybe you can rephrase it so we get a better idea...
Avatar of rowejd
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you wanted to add, say 10 pages or something, you could set up your pages array differently to be numeric:

$pages = array(1=>'page_colour.php', 2=>'page_age.php') etc...

Then instead of using the $i as a counter, you'd see what number the current page is in the array list and show the one just before it and just after it.  If this is what you're after, that's the way I do it.
Avatar of Dada44


Thanks! I had to do it in this way!