Jump to content

does anyone know how to get images from joomla using php?


divinedesigns1

Recommended Posts

i am trying to grab certain images from joomla, which is place in there own folders, but when i try to get

failed to open dir: No such file or directory in /xxxxx/xxxxxx/xx/xxxxxxx/html/Ej/test.php on line 10

but the folder is actually there.

i am using this code to grab the images from the folder, which i have tested it within a normal folder

$handle = opendir(dirname(realpath(__FILE__)) . '/images/');while($file = readdir($handle)){	if($file !== '.' && $file !== '..'){		echo '<img src="images/' . $file . '" border="0">';	}}
Edited by DDs1
Link to comment
Share on other sites

It sounds like you're trying to open the path to a file, not a directory.

 

Did you try echoing out all the variables that make up $handle to see if you're opening the correct directory?

 

echo "file => " . __FILE__; echo "realpath => " . realpath(__FILE__)); echo "dirname => " . dirname(realpath(__FILE__); echo "all together now " => . dirname(realpath(__FILE__)) . "/images/";

 

Also, I'm not sure what distinction you make between this and "normal" folders. Is there a difference aside from the content? As far as I know, directories just hold files and folders and that's pretty standard across all machines I've worked on.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...