<script type="text/javascript">
function loadimage(url){
var teget=document.getElementById("target");
teget.src=url;
}
</script>
<?php
$dir='images';
$mang= array();
$i=0;
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
// echo "$file\n";
$mang[$i]=$file;
$i+=1;
}
}
closedir($handle);
}
?>
<div style="width:600px; height:250px; float:left">
<img id="target" src="images/bg_menu_o.jpg" height="250" width="600" />
<?php
for($i=0;$i<8;$i++)
{
$path=$dir."/".$mang[$i];
echo '<img src="'.$path.'" height="50" width="50" onclick="loadimage(this.src)" />';
}
?>
</div>
1/21/2010
sử dụng hàm đọc floder làm 1 image galery đơn giản
Categories :
php
Bài viết liên quan:
- Tool quét - scan shell trong code php
- Tool WordPress Autocomplete for Notepad++
- share code hỗ trợ download 4share.vn
- php Code cắt chuỗi làm trích dẫn trong tiêu đề hoặc bài viết
- Code post bài lên blogspot không cần đăng nhập
- Code Chống DDos
- Cách Tạo trang 404 Error Page
- Bóc tách nội dung html của trang bất kỳ
Subscribe to:
Post Comments (Atom)
List
Profiles Information
About me : Nothing is 1 vài thứ - 1985
Places I've Lived : I ♥ Hà Nội
Home Page : http://www.shimivn.blogspot.com/
Think : 1:1000000000
Languages spoken : Vietnamese,English.
Mobile : sony C2305 ♥ ♥
dell : i3-Ram 3GB- HDD 250GB . ♥♥♥
Places I've Lived : I ♥ Hà Nội
Home Page : http://www.shimivn.blogspot.com/
Think : 1:1000000000
Languages spoken : Vietnamese,English.
Mobile : sony C2305 ♥ ♥
dell : i3-Ram 3GB- HDD 250GB . ♥♥♥
No comments: