English 中文(简体)
PHP 阅读器
原标题:PHP readdir dots keep being shown

我写了一幅简单的图像包裹,对一只双fold子进行检查,并展示双手里的所有图像,即有密码去除这些图像,但却没有工作,我很想知道,为什么任何帮助都对PHP的ir子功能来说是巨大的。 我有环绕这一联系的灯塔,因此,外加反应 该守则如下:

<?
// USER OPTIONS DEDFINED HERE

$dir = "img/";      //folder with images
$height ="196px";   //image height on page its displayed in full in lightbox
$width ="320px";    //image width on page its displayed in full in lightbox
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<title>Gallery</title> 
<link href="css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
</head>

<?

//open directory
if ($opendir = opendir($dir));

{

//read dir
while (FALSE !== ($file = readdir($opendir)))
{   
    if ($file!="."&&$file!="..")
        echo "<div class= imgwraper >";
        echo"<a href= $dir$file  rel= lightbox[gallery]  title= $filename >";
        echo "<img src= $dir$file  alt=   width= $width  height= $height />";
        echo"</a>";
        echo "<div class= name_box >";
        echo current(explode( . , $file));
        echo "</div>";
        echo "</div>";

}
closedir($opendir); 
}

?>

预支

Lewis

最佳回答

http://www.un.org/Depts/DGACM/index_chinese.htm

• 一切照样:

while (FALSE !== ($file = readdir($opendir)))
{   
    if ($file!="."&&$file!="..") {
        echo "<div class= imgwraper >";
        echo"<a href= $dir$file  rel= lightbox[gallery]  title= $filename >";
        echo "<img src= $dir$file  alt=   width= $width  height= $height />";
        echo"</a>";
        echo "<div class= name_box >";
        echo current(explode( . , $file));
        echo "</div>";
        echo "</div>";
    }
}

这样,你就可以考虑使用<条码>glob来简化你的代码。

问题回答

不要忘记,如果发言放在了曲解的方括号中的话。

while (FALSE !== ($file = readdir($opendir)))
{   
if ($file!="."&&$file!=".."){
    echo "<div class= imgwraper >";
    echo"<a href= $dir$file  rel= lightbox[gallery]  title= $filename >";
    echo "<img src= $dir$file  alt=   width= $width  height= $height />";
    echo"</a>";
    echo "<div class= name_box >";
    echo current(explode( . , $file));
    echo "</div>";
    echo "</div>";
}
}

Shai。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签