I'm fairly new to PHP and this script may contain a few obvious errors. I simply want to set up an array that lets you navigate using previous and next buttons. Based on the current php page this is included on, it should set up where it is in the array and set the $prev and $next variables accordingly.
<?php
$pages = array("apfelbaum.php", "bethtech.php", "bitronics.php");
foreach ($pages as $num => $current) {
$prev = $pages[$num-1];
$next = $pages[$num+1];
if ($doc_path.$current == $PHP_SELF)
break;
}
?>
<p align="center>
<a href="<?php print $prev; ?>">Previous</a> |
<a href="<?php print $current; ?>">Next</a>
</p>
the $current is being set to what $next should be and $prev is being set to what $current should be
Any suggestions would be appreciated. I do know C++ and some Basic, but PHP is fairly new to me.
Thanks for your time.
-Reid