Initial commit: Backup der Webseiten
- zoesch.de - blitzkiste.net - gruene-hassberge (norbert.zoesch.de) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
25
zoesch.de/ImageUpload/views/gallery.php
Normal file
25
zoesch.de/ImageUpload/views/gallery.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
//function call
|
||||
return showImages();
|
||||
//function defintion
|
||||
function showImages()
|
||||
{
|
||||
$out = '<h1>Image Gallery</h1>';
|
||||
$out .= "<ul id='images'>";
|
||||
$folder = 'img';
|
||||
$filesInFolder = new DirectoryIterator($folder);
|
||||
while ($filesInFolder->valid()) {
|
||||
$file = $filesInFolder->current();
|
||||
$filename = $file->getFilename();
|
||||
$src = "$folder/$filename";
|
||||
$fileInfo = new Finfo(FILEINFO_MIME_TYPE);
|
||||
$mimeType = $fileInfo->file($src);
|
||||
if ($mimeType === 'image/jpeg') {
|
||||
$out .= "<li><img src='$src' /></li>";
|
||||
}
|
||||
$filesInFolder->next();
|
||||
}
|
||||
$out .= '</ul>';
|
||||
|
||||
return $out;
|
||||
}
|
||||
Reference in New Issue
Block a user