|
cnn
|
Thank you very much Prodgalson for given me your precious time, I want to display only one image starting from the first when I click Next and the previous image when I click prev button but it is not done in the order in which the images are placed in the array. This is the code i used to select the images.
<body> <table border="0" align="center"> <?php $im0 = "<img src = './pic/car.gif' width = '150' height = '150'>"; $im1 = "<img src = './pic/fl.jpg' width = '150' height = '150'>"; $im2 ="<img src = './pic/house.jpg' width = '150' height = '150'>"; $im3 = "<img src = './pic/phone.gif' width = '150' height = '150'>"; $im4 = "<img src = './pic/pope.jpg' width = '150' height = '150'>"; $image = array($im0, $im1, $im2, $im3, $im4); shuffle($image); echo next($image); ?> </td></tr></table> <table align="center" border="0"> <form action="<?php $_SERVER['PHP_SELF'] ?>" method="post"> <input type ="submit" value ="Previous" name="prv"> <input type="submit" value="Next" name="nxt" /> </form> </td></tr></table> </body> I appreciate any suggestion on how best to do it. Cnn
|