|
|
|
|
Répondre à Anonym€
|
"Merci mais je suis incapable de faire un scriot php je ne connais que le html.
|
http://www.siteduzero.com/tutoriel-3-14668-un-site-dynamique-avec-php.html
|
Jai planché toute laprem pour aprendre le php ! jai réussis à faire ça (ça marche correctement) :
<html>
<head>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
</head>
<body>
<?php foreach(glob('*.JPG') as $file) {
?><a href="<?php echo "$file" ?>" rel="lightbox"><img src="<?php echo "$file" ?>" width="259" height="194" /></a>
<?php
}
?>
</body>
</html>
jai remis lightbox (que j'utilisais déjà) mais peut tu maider à mettre les photos dans un tableau à 3 colonnes stp ? Merci d'avance |
Aller, comme ça, à froid sans tester :
<html>
<head>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
</head>
<body>
<?php
$tableau = glob('*.JPG');
echo '<table>';
$i='0';
foreach( $tableau as $file) {
if ($i == '0') {
echo '<tr><td><a href="'.$file.'" " rel="lightbox"><img src="'.$file.'" width="259" height="194" alt="" /></a></td>';
}
if ($i == '1') {
echo '<td><a href="'.$file.'" " rel="lightbox"><img src="'.$file.'" width="259" height="194" alt="" /></a></td>';
}
if ($i == '2') {
echo '<td><a href="'.$file.'" " rel="lightbox"><img src="'.$file.'" width="259" height="194" alt="" /></a></td></tr>';
$i = '-1';
}
$i++;
}
if ( $i == '1' ) { echo '<td></td><td></td></tr>'; }
if ( $i == '2' ) { echo '<td></td></tr>'; }
echo '</table>';
?>
</body>
</html>
<br /><br /> Vivement la <font> des neiges... |