Bonjour,
je cherche tant bien que mal a afficher mes images (balise img)
Comme vous pouvez le voir sur ce lien https://www.djez.fr/pictureToSort/, la ou est indiqué "problème d'affichage", la photo ne se charge pas.
le chemin est correct car je parviens bien à afficher les infos des photos.
Voici mon .htaccess
Auriez vous une solution SVP ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 RewriteEngine On #RewriteCond %{SERVER_PORT} 80 #RewriteRule ^(.*)$ https://www.djez.fr/$1 [R,L] ReWriteRule .*\.(gif|png|jpe?g)$ - [F,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php
Pour info la page d'affichage des images
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 <h1>Photos à trier</h1> <?php $iterator = new DirectoryIterator(ROOT.'www'.DIRECTORY_SEPARATOR.'picturesToSort'); foreach($iterator as $file) { if($file->getType()<>'dir') { ?> <div class="pictureDescriptionPreview"> <div class="pictureDescription"> Nom: <?= $file->getFilename() ?><br> Taille: <?= $file->getSize() ?><br> Type: <?=$file->getType() ?><br> </div> <div class="picturePreview"> <img src="<?= ROOT.'www'.DIRECTORY_SEPARATOR.'picturesToSort'.DIRECTORY_SEPARATOR.$file->getFilename(); ?>" alt="problème d'affichage"> <?= file_exists(ROOT.'www'.DIRECTORY_SEPARATOR.'picturesToSort'.DIRECTORY_SEPARATOR.$file->getFilename()) ? "<br>oui Le fichier existe" :"<br>non le fichier n'existe pas" ?> </div> </div> <?php } } ?>
Partager