Re: Navigation

From: Date: Wed, 21 Feb 2001 01:59:32 +0000
Subject: Re: Navigation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-40874@lists.php.net to get a copy of this message
there are numerous posts on the list regarding this subject, I will give some code examples, I hope this helps. <?php include_once("database.egn"); $HOW_MANY = 10; if (!isset($pos)) $pos = 0; $pos_prev = $pos - $HOW_MANY; $pos_next = $pos + $HOW_MANY; $product_count = fetch_db_value('site', ''); while ($site = fetch_db_value('site', "LIMIT $pos, $HOW_MANY") ) { echo $site['site_address'] ."<br>\n"; } echo " <html> <body> "; if ($pos_prev >= 0) echo " <a href='$PHP_SELF?pos=$pos_prev'>Back</a> "; echo " <a href='$PHP_SELF?pos=0'>Home</a> "; if ( $pos_next < $product_count ) echo " <a href='$PHP_SELF?pos=$pos_next'>Next</a> "; echo " </body> </html> "; ?> simple, no complicated code here :) KISS. this can be easily modified to handle one at a time, change HOW_MANY = 1; -- Chris Lee Mediawaveonline.com em. lee@mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 ""Chris"" <php@elusionz.com> wrote in message news:0c8101c09ba4$dfc36400$0100a8c0@NISNix... > Hi there, I'm having difficulties, hoping I could get some help.. > > I have two links, "Next" and "Previous". I want the Next button to load the > next image, and previous for previous. > I have the links setup like so: http://bla.com/bla.php?image=# > where # is a > number, starting with 1. I want for # to increase by one each time a user > clicks it, as well as load that numbers image. I wanted to define each # as > a link to that image. > > Thanks, > Chris > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#40874) next »