You are not logged in.
Dear visitor, welcome to Aqua Computer Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Quoted
<html>
<?PHP
function blaettern($id){
?>
<center>
<?PHP
if($id<=0){$id=1;}
if($id>=2)
{
$last=$id-1;
?>
<a href="index.php?id=<?PHP echo($last); ?>">Zurück </a>
<a href="index.php?id=1">Anfang </a>
<?PHP
}
$next=$id+1;
?>
<a href="index.php?id=<?PHP echo($next); ?>">Weiter</a>
</center>
<br />
<br />
<?PHP
}
if(!$id){$id=1;}
blaettern($id);
include($id.".html");
?>
<br />
<br />
<?PHP
blaettern($id);
?>
</html>
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$path = '.'; // aktuelles verzeichnis
$files = array(); // hier kommen die dateien rein.
$dir = dir($path); // verzeichnis "öffnen"
while ($entry = $dir->read()) {
if (! is_dir($entry)) { // prüfen, ob kein verzeichnis
$files[] = $entry; // dateiname hinzufügen
}
}
$dir->close();
print_r($files); // alle dateinamen ausgeben (debug-ausgabe)
echo count($files); // anzahl der dateien ausgeben
|
This post has been edited 1 times, last edit by "Y0Gi" (Jan 22nd 2013, 4:24am)
Quoted
<html>
<?PHP
/* Anzahl der Dateien im Verzeichnis */
$path='.'; // aktuelles verzeichnis
$files=array(); // hier kommen die dateien rein.
$dir=dir($path); // verzeichnis "öffnen"
while ($entry=$dir->read()) {
if (! is_dir($entry)) { // prüfen, ob kein verzeichnis
$files[]=$entry; // dateiname hinzufügen
}
}
$dir->close();
// print_r($files); // alle dateinamen ausgeben (debug-ausgabe)
// echo count($files); // anzahl der dateien ausgeben
$end=count($files)-1;
/* Die Blaetter-Funktion */
function blaettern($id,$end){
?>
<center>
<?PHP
if($id<=0){$id=1;
}
if($id>=2)
{
$last=$id-1;
?>
<a href="index.php?id=<?PHP echo($last); ?>">Zurück </a>
<a href="index.php?id=1">Anfang </a>
<?PHP
}
if($id<$end){
$next=$id+1;
?>
<a href="index.php?id=<?PHP echo($next); ?>">Weiter</a>
</center>
<br />
<br />
<?PHP
}
}
/* Start! */
if(!$id){$id=1;}
/* Blaettern */
blaettern($id,$end);
/* Content */
include($id.".html");
?>
<br />
<br />
<?PHP
/* Blaettern */
blaettern($id,$end);
?>
</html>
) -