flemingmike Posted June 4, 2010 Share Posted June 4, 2010 hi all, quick question... if i have 5 pictures pic1.jpg, pic2.jpg, pic3.jpg, pic4.jpg and pic5.jpg and im viewing pic3.jpg, is there an easy way to make a left and right button to scroll through the pictures by adding or extracting a number? thx. Link to comment https://forums.phpfreaks.com/topic/203816-changing-pictures-by-number/ Share on other sites More sharing options...
chmpdog Posted June 4, 2010 Share Posted June 4, 2010 you could make a variable pic3 $i=3; $next =$i++; $prev =$i--; then echo $i Link to comment https://forums.phpfreaks.com/topic/203816-changing-pictures-by-number/#findComment-1067478 Share on other sites More sharing options...
greatstar00 Posted June 4, 2010 Share Posted June 4, 2010 <a href="pic.php?pic=3&act=previous">Previous</a> take the above as example pic=3, the current pic, and act is the action u doing, forward of backward if($_GET['act']=="previous") echo "pic".(--$_GET['pic'])."jpg"; Link to comment https://forums.phpfreaks.com/topic/203816-changing-pictures-by-number/#findComment-1067569 Share on other sites More sharing options...
ignace Posted June 4, 2010 Share Posted June 4, 2010 to make a left and right button to scroll through the pictures by adding or extracting a number? Sure, but what if you would delete a picture? Link to comment https://forums.phpfreaks.com/topic/203816-changing-pictures-by-number/#findComment-1067571 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.