RE: [PHP] creating <prev next > link

From: Date: Thu, 11 Mar 2004 14:36:20 +0000
Subject: RE: [PHP] creating <prev next > link
Groups: php.general 
Request: Send a blank email to php-general+get-180148@lists.php.net to get a copy of this message
[snip] Just say, Dave clicks on the apple to find out more info of this product.. on the product page how do i generate a <prev link to take Dave to Egg details and next> to take Dave to oil and once Dave is reading oil product details.. he should have <prev link to Apple and next > to meat any suggestion how i can creating this nav links from the array?? [/snip] Since the array has an index you can do this --- (pseudocode, you will know which one is clicked) array_count = count(array) if(0 == array_index){ // no <previous to display display next> = array_index++ } elseif(0 < array_index && array_index < array_count){ // display both display <prev = array_index-- display next> = array_index++ } elseif(array_count == array_index){ // no next> to display display <prev = array_index-- } HTH!

« previous php.general (#180148) next »