BillyBoB Posted August 17, 2006 Share Posted August 17, 2006 im trying to get the image name b-pic-0 and then when they press next it finds the image in the array and goes to the next one is there a way to do so ? please help,BillyBoB Link to comment https://forums.phpfreaks.com/topic/17892-solved-btw-there-is-the-source-for-all-the-noobs-image-slideshow-type-thing/ Share on other sites More sharing options...
AndyB Posted August 18, 2006 Share Posted August 18, 2006 Sure there's at least one way to do it. They all begin with you posting a reasonable amount of useful information along with the code you have already written ... or post your request in freelancing and offer something in return for a solution. Link to comment https://forums.phpfreaks.com/topic/17892-solved-btw-there-is-the-source-for-all-the-noobs-image-slideshow-type-thing/#findComment-76529 Share on other sites More sharing options...
BillyBoB Posted August 18, 2006 Author Share Posted August 18, 2006 sorry for not posting all of the above i figured it out and here is the finished code incase u want to ever do it:[code]<?phpif($_GET['pic']){ $pic = $_GET['pic']; echo(" <a href=\"viewpic.php?pic=$pic&full=y\" border = \"0\"><img src=\"halopics/$pic.jpg\" height=\"300\" width=\"490\" border = \"0\" /></a><br /><center>Click the Pic to Enlarge.</center><br />"); echo("<center><form method=\"POST\"><input type=\"submit\" name=\"back\" value=\"Back\" />\____/<input type=\"submit\" name=\"next\" value=\"Next\" /></form></center><br />"); $dir = './halopics/'; $handle = opendir($dir); while (($file = readdir($handle)) !== false) { if ( !in_array($file, array('.', '..') ) ) { $file_list[] = basename($file, '.jpg'); } } closedir($handle); asort($file_list); if($_POST['next']) { $currentfile = current($file_list); while($currentfile!=$pic) { $currentfile=next($file_list); } if(current($file_list)==$pic) { $nextfile = next($file_list); $pic = $nextfile; if(!$nextfile) { $pic = end($file_list); } } echo("<meta http-equiv=\"Refresh\" content=\"0; URL=http://dreamshowstudios.net/viewpic.php?pic=$pic\" />"); } if($_POST['back']) { $currentfile = current($file_list); while($currentfile!=$pic) { $currentfile=next($file_list); } if(current($file_list)==$pic) { $nextfile = prev($file_list); $pic = $nextfile; if(!$nextfile) { $pic = reset($file_list); } } echo("<meta http-equiv=\"Refresh\" content=\"0; URL=http://dreamshowstudios.net/viewpic.php?pic=$pic\" />"); } echo (" <center><form method=\"POST\">Select:<select name=\"pic\"> "); foreach($file_list as $key => $value){ echo (" <option>$value</option> "); } echo(" </select> <input type=\"submit\" name=\"submit\" value=\"View Pic\" /> </form></center> "); if($_POST['submit']) { $pic = $_POST['pic']; echo("<meta http-equiv=\"Refresh\" content=\"0; URL=http://dreamshowstudios.net/viewpic.php?pic=$pic\"/>"); }}else{ $dir = './halopics/'; $handle = opendir($dir); while (($file = readdir($handle)) !== false) { if ( !in_array($file, array('.', '..') ) ) { $file_list[] = basename($file, '.jpg'); } } closedir($handle); asort($file_list); echo (" <center><form method=\"POST\">Select:<select name=\"pic\"> "); foreach($file_list as $key => $value){ echo (" <option>$value</option> "); } echo(" </select> <input type=\"submit\" name=\"submit\" value=\"View Pic\" /> </form></center> "); if($_POST['submit']) { $pic = $_POST['pic']; echo("<meta http-equiv=\"Refresh\" content=\"0; URL=http://dreamshowstudios.net/viewpic.php?pic=$pic\"/>"); }}?>[/code]this code is copyrighted but you can use the basic design of it :) ;) Link to comment https://forums.phpfreaks.com/topic/17892-solved-btw-there-is-the-source-for-all-the-noobs-image-slideshow-type-thing/#findComment-76541 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.