我需要爲我的用戶提供下載所有在我的項目中顯示的圖片的機會。圖像顯示從這樣的一個MySQL查詢:從mysql結果下載圖片
$query = mysql_query("SELECT tl.customername, tl.visitdate, tl.employeename, pz.webpath from table tl
inner join pictures pz on pz.visitid = tl.visitid and pz.groupid = tl.groupid
inner join agenti ag on ag.idh = tl.employeeid
WHERE tl.visitdate >= '$from' AND tl.visitdate <= '$to'
AND tl.employeename like '$r_employee'
AND tl.customerowner like '$r_customer'
AND tl.customername like '$r_customername'
AND tl.visitdate like '$r_date'
group by pz.webpath order by tl.customername") or die(mysql_error());
while($associate = mysql_fetch_assoc($query)) {
echo '<li> <figure>
<img src="../core/includes/timthumb.php?src='.$associate['webpath'].'&w=200&h=200" />
<figcaption>
<h3>'.$associate['customername'].'</h3>
<h6>'.$associate['employeename'].'</h6>
<h6>'.$associate['visitdate'].' </h6>
';
echo '<a class="fancybox" rel="gallery" href="'.$associate['webpath'].'" title=" '.$associate['visitdate'].'/'.$associate['customername'].'">Big picture</i></a>';
echo '</figcaption>
</figure>
</li>';
$zip->addFromString(pathinfo (urldecode($associate['webpath']), PATHINFO_BASENAME), urldecode($associate['webpath']));
}
我該如何添加一個下載按鈕,將所有的圖像保存爲zip在用戶計算機上?
什麼的結果呢?實際的圖像數據或只是一個網址? 取決於你有多少用戶/圖像/服務器可能是一個比你期望的更大的問題。如果你給我更詳細的信息,我可以給你一個合適的解決方案 –
用拇指(timthumb) - >點擊 - >大圖(fancybox)返回一個網格中的網址。我需要下載所有在網格中以全分辨率顯示的圖片。 – rozatrra
這是完美的,並且都在同一臺服務器上的圖片?或者你是否也必須從其他地方取他們? –