bonjour,
je bricole une petite galerie photo en php toute simple:
Code :
- html>
- <head>
- <title>formulaire</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- </head>
- <body>
- <form action="upload.php" enctype="multipart/form-data" method="post">
- <input type="file" name="fichier">
- <textarea> </textarea>
- <input type="submit" value="envoyer">
- </form>
- </body>
- </html>
|
ici je stocke mes fichiers photos--->
Code :
- <html>
- <head>
- <title>upload</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- </head>
- <body>
- <?
- //renseignement fichiers
- $nom= $HTTP_POST_FILES["fichier"] ["name"];
- $type=$HTTP_POST_FILES["fichier"] ["type"];
- $tailles=$HTTP_POST_FILES["fichier"] ["size"];
- $nomtmp=$HTTP_POST_FILES["fichier"] ["tmp_name"];
- echo "$nom <br>$type<br>$taille<br>$nomtmp<br>";
- $copy=copy($fichier,$nom);
- echo "$copy";
- ?>
- </body>
- </html>
|
jusque là, çà peut aller, mais après je ne vois pas comment afficher les commentaires que j'ajoute sous chaque image...dans mon fichier destiner à afficher la galerie:
Code :
- <?php
- // Début de la configuration
- $repimages = "upload/";
- $repimagesopen = opendir($repimages);
- //## Fin de la configuration
- // Debut du tableau
- echo ( '<table>' ) ;
- echo ( '<tr>' ) ;
- while ($repimagesfile = readdir($repimagesopen))
-
- {
- $nb_cols=1;
- echo ( '<td valign="center" align="center"> <img src="' . $repimages.$repimagesfile . '" border="1"></a></td>' ) ;
- $i= ($i + 1) % $nb_cols;
-
- if ($i==0)
- {
- echo ( '</tr><tr>' ) ;
- }
-
- }
- echo ( '</tr>' ) ;
- echo ( '</table>' ) ;
- //## Fin du tableau
- closedir($repimagesopen);
- ?>
|
comment associer les textarea qui conviennent sous chaque image? ...
soyez indulgent sur mes bricolages en php, merci... et j'attends vos conseils avisé pour reussir à faire cette petite galerie toute simple..
cordialement.
---------------
blog Bretagne