|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I have found an image upload script that works perfectly (after a few changes).
Now I want to create a display page that will only display the images that correspond with a project ID (Select * FROM table WHERE project_id2 = %s (recordID) would be the normal script, but it does not display the image). Below is a script that will display all of the images, but like i said before, I only want to list the images that correspond to a recordID. f anyone could tell me what changes have to be made, it would be greatly appreciated. I am more than willing to post a limk to the current site so that anyone can see what i have in operation. here is the link o my site currently so that anyone can see and assist me. http://68.109.153.150:23/teletrol/survey.php includes upload form at bottom http://68.109.153.150/teletrol/project_list.php includes link that tells next page what recordID I want click Photos view on project id 6 <? if(isset($_GET['id'])) { include 'Connections/teletrol.php'; $id = $_GET['id']; $query = "SELECT name, type, size, content FROM upload WHERE id = '$id'"; $result = mysql_query($query) or die('Error, query failed'); list($name, $type, $size, $content) = mysql_fetch_array($result); header("Content-Disposition: attachment; filename=$name"); header("Content-length: $size"); header("Content-type: $type"); echo $content; exit; } ?> <html> <head> <title>Download File From MySQL</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <? include 'Connections/teletrol.php'; $query = "SELECT id, name FROM upload"; $result = mysql_query($query) or die('Error, query failed'); if(mysql_num_rows($result) == 0) { echo "Database is empty <br>"; } else { while(list($id, $name) = mysql_fetch_array($result)) { ?> <a href="download.php?id=<?=$id;?>"><?=$name;?></a> <br> <? } } ?> </body> </html> |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
the second link should be http://68.109.153.150:23/teletrol/project_list.php
|
|
![]() |
| Outils de la discussion | |
|
|