riffkool Posted May 22, 2006 Share Posted May 22, 2006 Hello,I am stuck in trying to figure out how to set a schedule for files. I have this code (below) that i have put together to pull all the files in a particular folder on the webserver and list them on a page. I would like to have an "add" button (you can see what i started in the code) next to each item listed from the folder so that I can populate another page with a "schedule" or seperate list of all the files that the user clicks the add button. I have no idea how to accomplish this. Can someone please point me in the right direction? I hope I explained it well enough.the include file:[code]<?php // Define the full path to your folder from root $path = "."; $fcount = 1; // Open the folder $dir_handle = @opendir($path) or die("Unable to open $path"); // Loop through the files echo "<table width=\"720\" align=\"center\"><tr><td width=\"240\" valign=\"top\">"; while ($file = readdir($dir_handle)) { if($file == "." || $file == ".." || $file == "index.php" || $file == "Thumbs.db" || $file == "list.php") continue; if ($fcount <=25) {echo "<a href=\"\"><img src = ../add.gif><a> "; echo "$fcount.."; echo "<a href=\"$file\">$file</a>"; echo "<br>"; $fcount++; } elseif ($fcount == 26) {echo "</td><td cellpadding=\"10\" width=\"240\" valign=\"top\">"; echo "<a href=\"\"><img src = ../add.gif><a> "; echo "$fcount.."; echo "<a href=\"$file\">$file</a>"; echo "<br>"; $fcount++; } elseif ($fcount <= 50) {echo "<a href=\"\"><img src = ../add.gif><a> "; echo "$fcount.."; echo "<a href=\"$file\">$file</a>"; echo "<br>"; $fcount++; } elseif ($fcount == 51) {echo "</td><td cellpadding=\"10\" width=\"240\" valign=\"top\">"; echo "<a href=\"\"><img src = ../add.gif><a> "; echo "$fcount.."; echo "<a href=\"$file\">$file</a>"; echo "<br>"; $fcount++; } elseif ($fcount <= 75) {echo "<a href=\"\"><img src = ../add.gif><a> "; echo "$fcount.."; echo "<a href=\"$file\">$file</a>"; echo "<br>"; $fcount++; } } ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10219-directory-and-file-links/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.