Affichage d'image avec php |
|
| Voir le sujet précédent :: Voir le sujet suivant |
| Auteur |
Message |
phpding html mioche

|
Affichage d'image avec php , Posté le: 12-05-2005 20:26 |
|
|
Bonjour, une petite question bête:
Voici un code qui affiche dynamiquement une image devant un liens lui aussi afficher dynamiquement par le code php de la page index.php de EasyPHP:
_____________________________________________________________
print("&&<img src='images_easyphp/dossier.gif' width='23' height='16' align='absbottom'>&");
_____________________________________________________________
Ce code affiche la même image pour chaque liens, j'aimerai qu'il affiche à la place devant chaque dossier la premiere image .gif ou .jpg nomé img.gif ou img.jpg qu'il trouve dans le dossier afficher.
Quelqu'un saurait-il faire sa ? |
|
|
phpding html mioche

|
re , Posté le: 12-05-2005 20:27 |
|
|
Voici la page complette :
_____________________________________________________________
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?
// Par défaut : anglais
$directoryListing = "Folders in server root (\"www\")";
$noDir = "no folder";
$presentation = "This page display folders in server root. You can delete this page if you want to organize differently the folder. There'e a backup oh this file in &safe& directory (index-safe.php).";
$browser_languages = explode(",", getenv("HTTP_ACCEPT_LANGUAGE"));
$nb_browser_languages = sizeof($browser_languages);
$browser_lang = ""; // ne pas initialiser
$biContinue = true;
for ($niI = 0; $biContinue==true && $niI < $nb_browser_languages; $niI++)
{
$biContinue = false;
$lg = explode("-", $browser_languages[$niI]);
switch ($lg[0])
{
case "fr" : $directoryListing = "Racine du site";
$noDir = "aucun répertoire";
$presentation = "000";
break;
case "en" : break;
default: $biContinue = true;
}
}
?>
<html>
<head>
<title>[EasyPHP] - Web Local</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
.text1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: White;text-align : left;}
.text2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;color: Silver;text-align : left;}
.titre1 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #FFFFFF;}
.titre2 {font-family: Arial, Helvetica, sans-serif;font-size: 12px;font-weight: bold;color: #cccccc;}
</style>
</head>
<body bgcolor="#525A73">
<div align="center"></div>
<table width="500" border="0" cellspacing="4" cellpadding="0" align="center">
<tr>
<td>&</td>
<td width="100%" nowrap class="titre1">&<? echo $directoryListing; ?>&:</td>
</tr>
</table>
<table width="500" border="0" cellspacing="2" cellpadding="0" align="center">
<?
$rep=opendir('.');
$bAuMoinsUnRepertoire = false;
while ($file = readdir($rep)){
if($file != '..' && $file !='.' && $file !=''){
if (is_dir($file)){
$bAuMoinsUnRepertoire = true;
print("<tr><td nowrap class='text1'>&&&&&&</td>");
print("<td width='100%' class='text1'>");
print("&&<img src='images_easyphp/dossier.gif' width='23' height='16' align='absbottom'>&");
print("<a href='$file/' class='text1'>$file</a>");
print("</td></tr>");
}
}
}
if ($bAuMoinsUnRepertoire == false) {
print("<tr><td nowrap class='text1'><div align='center'>-& $noDir &-</div></td>");
print("</td></tr>");
}
closedir($rep);
clearstatcache();
?>
</table>
<br>
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td class="text1">
<? echo $presentation ?>
</td>
</tr>
</table>
</body>
</html>
_____________________________________________________________ |
|
|
|
 |
Accueil Forum
-> php |
Toutes les heures sont au format GMT + 1 Heure
|
| Page 1 sur 1 |
|
S'enregistrer
Profil
Se connecter pour vérifier ses messages privés
Rechercher
Membres
FAQ
Connexion
|