2014-09-01 83 views
-3

我正在開發一個Instagram的畫廊,我有用戶圖片顯示在一個HTML頁面上,我想要的是用戶可以選擇一些圖片,並通過單擊按鈕圖片網址將發送到我的電子郵件。在此先感謝,選擇圖像並提交它

這裏是顯示圖像的代碼:

$<?php 
$popular = $instagram->getUserMedia($data->user->id); 

Display results 
foreach ($popular->data as $data) { 
    echo "<img src=\"{$data->images->thumbnail->url}\">"; 

} 

?> 

前瞻:image

我想類似這樣的東西: http://rvera.github.io/image-picker/

的一部分,它說選擇多個,但whith一個按鈕,將發送所有選定的圖片的網址。

回答

0

爲什麼不使用http://rvera.github.io/image-picker/。看起來不錯

<select id="myId"> 
<?php foreach ($popular->data as $data): ?> 
    <option data-img-src='<?php echo $data->images->thumbnail->url ?>' value='<?php echo $data->images->thumbnail->url ?>'>blah blah</option> 
<?php endforeach; ?> 
</select> 


<script type="text/javascript"> 
    $(function() { // code required jquery and image picker. Add those in head section 
     $("#myId").imagepicker(); // you can pass param too customize it in your manner 
    }) 
</script> 
+0

添加了代碼,但圖像不顯示只有empy選擇框, – 2014-09-01 13:42:13