Kan du ikke lige indsætte det for mig.??
Her er index.php:
<html>
<head>
<link rel="stylesheet" type="text/css" href="../style.css">
<title>-:-| Madsass.dk - Babes |-:-</title>
<Script Language="JavaScript">
PositionX = 100;
PositionY = 100;
defaultWidth = 1044;
defaultHeight = 788;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();
}}
</script>
</head>
<body>
<div align="center">
<?php
$dir = "Babes/"; // Mappe med billeder
$pr_side = 10; // Antal billeder pr side
$pr_linie = 2; // Antal billeder pr række
$out = "<div style='text-align: center'>\n"; // Alt output bliver samlet i $out
$out .= "<table style='margin: 5px; text-align: center; border-top: solid #000000 0px; border-left: solid #000000 0px; border-right: solid #000000 0px;'>\n";
$offset = isset($_GET['offset']) ? $_GET['offset'] : 0;
$liste = hentFiler($dir); // Henter array med filer fra mappen: "$dir"
$antal_filer = count($liste);
$max = min(($offset+$pr_side),$antal_filer);
$i = $offset;
$j = 0;
while ($i<$max) {
if ($j%$pr_linie == 0) $out .= "<tr>\n";
$out .= "<td style='padding: 5px;'>\n<a href=java script:popImage('".$dir.$liste[$i]."','$liste[$i]')><img height='200' width='200' border='1' style='border-color: #000000' src='".$dir.$liste[$i]."' /><br>$liste[$i]</a>\n</td>\n";
if ($j%$pr_linie == $pr_linie-1) $out .= "</tr>\n";
$i++;$j++;
}
if ($j%$pr_linie != 0) $out .= "</tr>\n";
$out .= "</table>\n";
$out .= $offset>0 ? "<a href='".$_SERVER['PHP_SELF']."?side=Babes/index.php&offset=".($offset-$pr_side)."'><< Forrige |</a> \n" : "<< Forrige | \n";
$antal_sider = floor($antal_filer/$pr_side);
if ($antal_sider>0) {
for ($i=0;$i<=$antal_sider;$i++) {
$n = $i*$pr_side;
if ($n != $offset) $out .= "<a href=\"index.php?side=Babes/index.php&offset=$n\">".($i+1)."</a> \n";
else $out .= ($i+1)." ";
}
}
$out .= $offset<($antal_filer-$pr_side) ? " <a href='".$_SERVER['PHP_SELF']."?side=Babes/index.php&offset=".($offset+$pr_side)."'>| Næste >></a>\n" : "| Næste >>\n" ;
$out .= "</div>\n";
echo $out; // Spyt ud!
// Funktion der returnerer billederne fra mappen '$dir' i et array()
function hentFiler($dir) {
if ($d = dir($dir)) {
while (false !== ($file = $d->read())) {
if(eregi(".jpg$|.gif$|.png$", $file)) {
$files[] = $file;
}
}
$d->close();
}
return $files;
} // End function
?><br>
<font face="Verdana" size="1"><b>Upload en babe eller et par stykker eller 10:</b></font><br><br>
<form method="post" action="Babes/post.php" enctype="multipart/form-data">
<input type="hidden" name="action" value="upload">
<input type="file" class="input" name="file[]" style="width: 248px"><br>
<input type="file" class="input" name="file[]" style="width: 248px"><br>
<input type="file" class="input" name="file[]" style="width: 248px"><br>
<input type="file" class="input" name="file[]" style="width: 248px"><br>
<input type="file" class="input" name="file[]" style="width: 248px"><br>
<input type="file" class="input" name="file[]" style="width: 248px"><br>
<input type="file" class="input" name="file[]" style="width: 248px"><br>
<input type="file" class="input" name="file[]" style="width: 248px"><br>
<input type="file" class="input" name="file[]" style="width: 248px"><br>
<input type="file" class="input" name="file[]" style="width: 248px"><br>
<input type="submit" class="input" value="Upload">
</form><br>
<font face="Verdana" size="1"><b>Bemærk:</b> Filnavnene må ikke indeholde / \ eller ;</font><br>Følgende tegn vil blive byttet ud med "LoL"..<br><br>
<a href="Admin/Andet/Slet_Babes.php" target="_blank"><font face="Verdana" size="1"><b>Admin</b></font></a>
</div>
</body>
</html>
Og her er post.php som uploader filen:
<?php
include('config.php');
if ($_POST['action'] == 'upload') {
for ($i=0;$i<count($_FILES['file']['name']);$i++) {
if ($_FILES['file']['name'][$i] != '') {
move_uploaded_file($_FILES['file']['tmp_name'][$i], ''.$_FILES['file']['name'][$i]);
}
}
header("Location:
http://www.madsass.dk/index.php?side=Babes/index.php");
}
?>
Indsæt det venligst for mig..