Hele min kode ser sådan her ud, hvis det kan hjælpe nogen.
<?
$dir = $_GET[serie];
$def = "Afskedsfest 1Z part one";
if($dir==NULL){
$dir = $def;
} ?>
<!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=windows-1252" />
<title>photo.worm</title>
<style type="text/css">
body { text-align: center; margin: 0 auto; padding: 0px; background: #333; color:#fff; }
#topborder { height: 15px; background: #fff; font-family: 'Lucida Grande', Verdana, Arial, Helvetica, Sans-Serif;
font-size: 11px;
color: #333; text-align: right; }
#top { background: #333 url('logo.jpg') right top no-repeat; height: 75px; }
#container {
margin: 0 auto; width: 70%; }
img {
border: 5px solid #fff;
display: block;
margin-left: auto;
margin-right: auto;
text-align:center;
background-color: #fff;
}
#info {
border: 5px solid #fff;
display: block;
margin-left: auto;
margin-right: auto;
text-align:left;
background-color: #fff;
width: 600px;
background: #333;
}
p { padding: 5px; }
a img {
border: none;
}
a:link {
color: #fff;
text-decoration: none;
}
a:visited {
color: #fff;
text-decoration: none;
}
a:hover {
color: #FF00C6;
border-bottom: #fff 2px solid;
}
a:hover.menu {
color: #FF00C6;
border-left: #fff 5px solid;
}
a:active {
color: #fff;
background-color: #FF00C6;
}
.boks {
font-family: 'Lucida Grande', Verdana, Arial, Helvetica, Sans-Serif;
font-size: 11px;
color: #fff;
line-height: 16px;
margin: 0px;
width: 830px;
background-color: #333;
padding-left: 2px;
padding-bottom: 1px;
text-align: left;
}
.billeder {
padding-right: 2px;
text-align: left; float: right; width: 620px; }
.menu { float: left; width: 180px; border: 5px solid #fff; }
</style>
</head>
<body>
<div id="topborder">send en mail med serie og billedenavn for at få et billede taget ned - worm@worm-media.dk</div>
<div id="top"></div>
<div id="container">
<div class="boks">
<div class="menu"><p><?
/* 1337 4$C11 |-|4X()|2
jb.euroloser.dk */
if ($handle = opendir("./")) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && filetype($file)=="dir")
{
$out[] .= "<a href=\"?serie=$file\">$file</a><br />\n";
}
}
closedir($handle);
}
if(count($out)>=1){
sort($out);
reset($out);
foreach($out AS $link){ echo $link; }
}else{ echo $out[0];
}
?><br/>
Copyright 2005 <a href="mailto:worm@worm-media.dk?subject=photo.worm">KWA</a></p>
</div>
<div class="billeder">
<div id="info"><p>
<b><?
echo "$dir"; ?></b><br/>
<?
if(!$connection = mysql_connect("$host", "$user", "$pass")){ die("nope"); }
if(!mysql_select_db("$db")){ die("Unknown db!"); }
$dat = mysql_query("SELECT * FROM serie_data WHERE titel LIKE '%$_GET[serie]%'");
$get = mysql_fetch_array($dat);
if($get[tekst]){ echo $get[tekst]; }
else{ ?>Ingen info<?}
?></p></div><br/><?
function CheckExt($filename, $ext) {
$passed = FALSE;
$testExt = "\.".$ext."$";
if (eregi($testExt, $filename)) {
$passed = TRUE;
}
return $passed;
}
//Define an array of common extensions.
$exts = array("gif","jpg$|\\.jpeg","png","bmp");
$myDirectory = opendir("$dir");
$files = readdir($myDirectory);
while (false !== ($files = readdir($myDirectory))) {
foreach ($exts as $value) {
if (CheckExt($files, $value)) {
echo "<a href=\"mailto:worm@worm-media.dk?subject=anmeld billede\"><img src=\"$dir/$files\" alt=\" \"/></a><br/>\n";
$count++; //Keep track of the total number of files.
break; //No need to keep looping if we've got a match.
}
}
}
//Be a good script and clean up after yourself...
closedir($myDirectory);
?></div>
</div></div>
</body>
</html>
(c) Kasper Worm andersson