Hat dir diese Antwort geholfen?
Na aber sicher pack ich euch das Script mal hier rein wollt nur nich vorher schon Stress verbreiten ...
Also hier ist es;
<?php
echo'<html>';
echo'<head>';
echo'<title>Preview</title>';
echo'<style type="text/css">';
echo'<!--';
echo'body { background-color: #EEEEEE; margin-top: 100px;}';
echo'p, tr, td, br { font-size:12px; font-family:Verdana,Arial,sans-serif; color: #000000; }';
echo'font { font-size:12px; font-family:Verdana,Arial,sans-serif; color: #FF0000; }';
echo'b {font-size: 13px; font-weight: bold;}';
echo'a {font-weight: bold;}';
echo'-->';
echo'</style>';
$formname = "leer1";
$project = "leer2";
$username = ("********"); // Username
$password = ("********"); // Passwort
$folder = "seiten/"; // Ordnername
$summe = "0";
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function allowed() {
?>
</head>
<body>
<div align="center">
<form enctype="multipart/form-data" action="index.php" method="post">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="45%">Projektname:</td>
<td width="55%">
<input name="project" type="text" value="" size="25" style="width:150px;">
</td>
</tr>
<tr>
<td width="45%"> </td>
<td width="55%"> </td>
</tr>
<tr>
<td><input type="hidden" name="formname" value="project"></td>
<td>
<div align="center">
<input type="submit" name="login" value="Login"> <input type="reset" name="cancel" value="Cancel">
</div>
</td>
</tr>
</table>
</form>
<br>
<br>
<br>
<form enctype="multipart/form-data" action="index.php" method="post">
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="45%">Benutzername:</td>
<td width="55%">
<input name="user" type="text" value="" size="25" style="width:150px;">
</td>
</tr>
<tr>
<td width="45%"> </td>
<td width="55%"> </td>
</tr>
<tr>
<td width="45%">Passwort:</td>
<td width="55%">
<input name="pass" type="password" value="" size="25" style="width:150px;">
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>
<div align="center">
<input type="hidden" name="formname" value="admin">
</div>
</td>
<td>
<div align="center">
<input type="submit" name="login" value="Login"> <input type="reset" name="cancel" value="Cancel">
</div>
</td>
</tr>
</table>
</form>
</div>
<?
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function notAllowed() {
?>
</head>
<body>
<div align="center">
<form enctype="multipart/form-data" action="index.php" method="post">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="45%">Projektname:</td>
<td width="55%">
<input name="project" type="text" value="" size="25" style="width:150px;">
</td>
</tr>
<tr>
<td width="45%"> </td>
<td width="55%"> </td>
</tr>
<tr>
<td>
<div align="center"><input type="hidden" name="formname" value="project"></div>
</td>
<td>
<div align="center">
<input type="submit" name="login" value="Login"> <input type="reset" name="cancel" value="Cancel">
</div>
</td>
</tr>
</table>
</form>
<br>
<font>Entweder stimmen ihre Angaben nicht oder Sie sind nicht berechtigt.</font><br>
<br>
<form enctype="multipart/form-data" action="index.php" method="post">
<table width="300" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="45%">Benutzername:</td>
<td width="55%">
<input name="user" type="text" value="" size="25" style="width:150px;">
</td>
</tr>
<tr>
<td width="45%"> </td>
<td width="55%"> </td>
</tr>
<tr>
<td width="45%">Passwort:</td>
<td width="55%">
<input name="pass" type="password" value="" size="25" style="width:150px;">
</td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>
<div align="center">
<input type="hidden" name="formname" value="admin">
</div>
</td>
<td>
<div align="center">
<input type="submit" name="login" value="Login"> <input type="reset" name="cancel" value="Cancel">
</div>
</td>
</tr>
</table>
</form>
</div>
<?
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if( $formname == "admin" ){
if( $user == $username && $pass == $password){
echo '<center><table width="400" border="0" cellspacing="0" cellpadding="0">';
echo '<tr><td colspan="2" align="center"><u><b>Folgende Projekte wurden gefunden:</b></u></td></tr>';
echo'<tr><td colspan="2"> </td></tr>';
$open = opendir ($folder);
$zaehler = 0;
while ($file = readdir ($open)) {
if($file != "." && $file != ".."){
if(is_file ($file) == false) {
$verzeichnis_datei[$zaehler] = $file; //Verzeichnisnamen in ein Array packen
$zaehler++;
}
}
}
asort($verzeichnis_datei);
reset($verzeichnis_datei);
foreach($verzeichnis_datei as $wert) { // Verzeichnisse anzeigen
echo '<tr><td colspan="2"> </td></tr>';
echo '<tr><td align="center" width="30%">';
echo '<a href="'.$folder.$wert.'" target="_blank"><img src="'.$folder.$wert.'/preview/thumb.jpg" border="0"></a>';
echo '</td>';
echo '<td align="center" valign="middle"><a href="'.$folder.$wert.'" target="_blank">'.$wert.'</a>';
echo '</td></tr>';
}
echo '</td></tr></table></center>';
closedir ($open);
}
else{
echo notAllowed();
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
elseif( $formname == "project"){
if( $project != ""){
$open=opendir ($folder);
while ($file = readdir ($open)) {
if($file != "." && $file != ".."){
if(is_file ($file) == false) {
if( $file == $project){
$summe = "1";
$side = $project;
}
}
}
}
if ( $summe == "1"){
?>
<script language="JavaScript" type="text/javascript">
<!--
var side = "<? echo $side; ?>";
eval(window.location.href="seiten/" + side + "/index.html");
//-->
</script>
</head>
<body>
</body>
</html>
<?
}
else{
echo notAllowed();
}}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
else{
echo allowed();
}
?>
Danke für Eure Mühe
MFG Ich