mulazim Posted March 31, 2008 Share Posted March 31, 2008 i have creating an script of php which upload the file now i need to display those images how can id do this. Regards ,Mulazim Jamali ??? Software Developer http://www.minimarksoft.com Link to comment https://forums.phpfreaks.com/topic/98762-php-script-for-upload-file-dispaly/ Share on other sites More sharing options...
zenag Posted March 31, 2008 Share Posted March 31, 2008 download.php page $query = "SELECT id, name FROM tablename"; $result = mysql_query($query) or die('Error, query failed'); if(mysql_num_rows($result) == 0) { echo "Database is empty <br>"; } else { while(list($imageid, $fieldname) = mysql_fetch_array($result)) { ?> <a href="download.php?id=<?php echo $imageid;?>"><?php echo $fieldname;?></a> <br> <?php } } Link to comment https://forums.phpfreaks.com/topic/98762-php-script-for-upload-file-dispaly/#findComment-505406 Share on other sites More sharing options...
zenag Posted March 31, 2008 Share Posted March 31, 2008 this query is option to save and open image .... <? if(isset($_GET['imageid'])) { $id = $_GET['imageid']; $query = "SELECT fieldname FROM tablename WHERE id = '$id'"; $result = mysql_query($query) or die('Error, query failed'); list($fieldname) = mysql_fetch_array($result); $filepath="imagepath "; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=$fieldname"); header( "X-LIGHTTPD-send-file: . $filepath"); @readfile($file); Link to comment https://forums.phpfreaks.com/topic/98762-php-script-for-upload-file-dispaly/#findComment-505409 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.