Re: navigation

From: Date: Tue, 30 Jan 2007 00:36:13 +0000
Subject: Re: navigation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-247980@lists.php.net to get a copy of this message
On Sat, January 27, 2007 8:42 am, koen wrote: > How to creat the effect of the explorers back and forward buttons in > php? Something like this, except I almost for sure have a one-off error or got the 'push' confused with 'shift' as I always do... <?php $session_start(); $history = $_SESSION['history']; $current_page = array_pos($_SERVER['PHP_SELF'], $history); if ($current_page === false){ array_push($_SERVER['PHP_SELF'], $history); $current_page = 0; $_SESSION['history'] = $history; } if (count($history) > $current_page){ $last_page = $history[$current_page - 1]; echo "<a href=\"$last_page\">Back</a>\n"; } else echo "Back"; if ($current_page !== 0){ $next_page = $history[$current_page + 1]; echo "<a href=\"$next_page\">Next</a>\n"; } else echo "Next"; ?> -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#247980) next »