Results 1 to 2 of 2

Thread: PHP Script

  1. #1
    Join Date
    Oct 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP Script

    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:

    PHP Code:
    /* 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>

  2. #2
    Join Date
    Nov 2011
    Location
    Buenos Aires
    Posts
    15
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    "pic".$i;

    how about to add a value $i=1, then before the end loop do it $i=$i+1;

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •