Link to home
Start Free TrialLog in
Avatar of lilyyan
lilyyan

asked on

how to includes different files by clicking on a forword button and backword button in a php page?

hello:
in php page, there is some conent and in this page, i also need to includes file:
but i have a list of files and i put the file names in an array: (please see the code )

i want to put two buttons in the page, one for forward, the other for backward. each time when user click on button, it will include a different file.

any suggestion for how to implement this? a simple code will be greatly appreciated! thanks a lot!

<?php
$pages = array("content/home_01.php","content/home_02.php","content/home_03.php","content/home_04.php","content/home_05.php");
$page = $pages[0];?>
<?php includes ('./folder/file1.php') ?>.

Open in new window

SOLUTION
Avatar of codeQuantum
codeQuantum
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lilyyan
lilyyan

ASKER

thanks you so much! i'm trying your code...

would you please more specific on how iterate the array? i'm kind of confused.

looks like every time i need plus 1 for foward and minus 1 for backword... i don't know how to do this..
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lilyyan

ASKER

COOL!!. THANKS VERY MUCH!
You are welcome. :)