rrfuertes
10-31-2011, 06:00 AM
Hi guys! i'm trying to make a pure css database image gallery. I already make a random selection of images. The problem is i want to automatically change the value of html id ex. (id="pic1") and html href ex. (href="#pic1") for every images that will generated by php and connect the first php script to the 2nd php script from the bottom. Any idea guys? please help. thank you in advance.
example of the script:
/* already connected to database */
<html>
<body>
<div id="gallery">
<div id="slides">
<div id="slide1">
<ul>
<?php
while ($myrow = mysql_fetch_array(result)) {
echo '<li><img class="blank" src=' . "images/{$myrow['image_name']}.jpg" . ' alt=""></li> ' ;
echo '<li><a href="#pic1">';
echo '<img src=' . "images/{$myrow['image_name']}.jpg". ' alt="Winter branches"></a></li>';
}
?>
<div id="fullsize">
<?php
echo '<div id="pic1">';
echo '<img src=' . "images/{$myrow['image_name']}.jpg". ' alt="Winter branches">';
echo '<h3>Winter branches</h3>';
echo '</div>';
?>
</body>
</html>
example of the script:
/* already connected to database */
<html>
<body>
<div id="gallery">
<div id="slides">
<div id="slide1">
<ul>
<?php
while ($myrow = mysql_fetch_array(result)) {
echo '<li><img class="blank" src=' . "images/{$myrow['image_name']}.jpg" . ' alt=""></li> ' ;
echo '<li><a href="#pic1">';
echo '<img src=' . "images/{$myrow['image_name']}.jpg". ' alt="Winter branches"></a></li>';
}
?>
<div id="fullsize">
<?php
echo '<div id="pic1">';
echo '<img src=' . "images/{$myrow['image_name']}.jpg". ' alt="Winter branches">';
echo '<h3>Winter branches</h3>';
echo '</div>';
?>
</body>
</html>