3 Years
Discussion Span
Last Post by diafol

Show any code that you have so far.

//Path to folder which contains images
$dirname = "../public_html/wp-content/uploads/2015/tc/";

//Use glob function to get the files
//Note that we have used " * " inside this function. If you want to get only JPEG or PNG use
//below line and commnent $images variable currently in use
$images = glob($dirname."*");

//Display image using foreach loop
foreach($images as $image) {

//print the image to browser with anchor tag (Use if you want really :) )
echo '<p><a href="'.$image.'" target="_blank"><img src="'.$image.'" alt="filename" /></a></p>';

ya also i tried other codes but sometimes getting error in sql query or many methods i have tried like uploading image to folder setting up the file path in database then trying to fetch i got stuck with all.
It would be great help if you can provide for the same.


I.m confused as to what part of the code doesn't work. SQL and writing to db is all down to you, nothing to do with other people's scripts. Your best bet is to stick with a trusted script and persevere IMO.

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.