0

Hello everyone,
I need help here. So my problem is how I want to make an image slider where show user uploaded images from his directroy/folder/account whatever.
I would like to create like this image slider.

I tried to create it.... here it is.

and my php code is like this...

  <?php
            $i=1;
            $images = glob($des."*");
            $coutimage=count($images);
            //for($i=0;$i=$coutimage;$i++)
                //sleep(1);
                $curruntimage=$images[$i];
              echo '<img id="inslider" src="'.$curruntimage.'">';
            ?>
            </div></center>
            <div id ="userimageslist">
                <div id="moveleft"></div>
                <div id="moveright"></div>
            <?php
            $images = glob($des."*");
            foreach($images as $image){
                $image_ext = pathinfo($image,PATHINFO_EXTENSION);
                if($image_ext == "jpg" || $image_ext == "png" || $image_ext == "jpeg" || $image_ext== "gif" ){
            //<a href="'.$image.'" target="_blank">
                echo '<img id="imagelist" src="'.$image.'" height="100" width="100">';
                }
            }
            ?>

can u give any idee how i get images from users directory with ajex and create image slider like this imageslider where user can see his all photos on his account?

5
Contributors
8
Replies
52
Views
2 Years
Discussion Span
Last Post by Makara
0

I need help here. I want to make an image slider to show the user uploaded images from his directory/folder/account whatever. I would like to create something like this image slider.

I tried to create it.... here it is.

and my php code is like this....

can u give any idee how i get images from users directory with ajex and create image slider like this imageslider where user can see his all photos on his account?

0

There are a number of JS libraries that provide plugins that are pretty easy to use. JQuery is probably the most popular. There are many, many image sliders (JQuery and others) and it is relatively easy to embed the calling code in a PHP program. You shouldn't need any help from this forum to do a search to find these or to write the relatively simple code to use them.

0

i a lot of googled and tried a huge of image sliders but they doesnt work... and everywhere they use img tag for every image like this

      <img src="slide1.jpg" />
      <img src="slide2.jpg" />
      <img src="slide3.jpg" />
      <img src="slide4.jpg" />

but i have code lke dis..

foreach($images as $image)
echo '<img id="imagelist" src="'.$image.'" height="100" width="100">';

how can i make image slider with dis code..

:'(
sry for bad english;

Edited by phoenix254

0

Yes, indeed the javascript slider must be based on <img src="slide1.jpg" /> but actually it all depends how you are going to configure your code to suit the condition. Most of the javascript plugin is supporting the format of '<img id="imagelist_1" src="image_1.jpg"> where you just have to change your echo part accordingly and implement their js, and include your own scripting to made it work.

0

Kindly refer to the below code to get the Java Script function to slide the images`

<head>
<script type="text/javascript">
var image1 = new Image()
image1.src = "images/pentagg.jpg"
var image2 = new Image()
image2.src = "images/promo.jpg"
</script>
</head>
<body>
<p><img src="images/pentagg.jpg" width="500" height="300" name="slide" /></p>
<script type="text/javascript">
        var step=1;
        function slideit()
        {
            document.images.slide.src = eval("image"+step+".src");
            if(step<2)
                step++;
            else
                step=1;
            setTimeout("slideit()",2500);
        }
        slideit();
</script>
</body>Inline Code Example Here

Remember to change your images as they appear in the folders(your folder)`

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.