G'day all I have a web page were users can upload and downloads files. When they go to download a file A list of files they can download is displayed and a check box next to each file name and a button, with which the users can click to download the selected file.
What I would like to know what would be the best method of doing this? Would it be best to imbed the whole thing in a form, or is there another way that php can get the file information from the check box. The code I am working on is below, I am not very effient and a newbie at php so please excuse the mess Thanks Heaps cj //This gets the information of the owner and location of the file from the db $result = mysql_query("SELECT * FROM binary_files WHERE owner='$owner' and location='$location'", $db); //this displays a table with Name, Size, and info. echo "<tr><td></td><td>Name</td><td>Size</td><td>Info</td></tr>\n"; $myfile="0"; //This fetchs the file information from the above mysql_query while ($myrow = mysql_fetch_array($result, MYSQL_ASSOC)) { //this displays a table with a checkbox, I would like the file_id to be the value for the checkbox (not //working) the check box gets no value echo "<tr><td><input TYPE=checkbox NAME=filetodownload VALUE=$myrow[id_files] UNCHECKED></td>"; echo "<br>"; echo "File To Download: "; echo $filetodownload; echo "<br>"; //This displays a link to the file download.php with the url varieble filedownload which equels the file_id obtained from the db echo "<td><a href=download.php?filedownload=$myrow[id_files]>$myrow[filename]</a></td>"; //This displays the filesize echo "<td>$myrow[filesize]</td>"; //this display a info link (not yet implemented echo "<td><a href=info.php?fileinfo=$myrow[id_files]><img src=/Images/Info.png hspace=0 vspace=0 border= 0></a></td>"; echo " //This displays a image, with a link to download.php with the url variable filedownload which contains the //file_id from the check box above (not working) <a href=/upload/download.php?filedownload=$filetodownload target=main><img src=/Images/icons.php?text=Download&color=red border=0 border=0></a> "; } echo "</table>\n"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php