Jump to content

need help search images in folder and subfolder


blacktiger786

Recommended Posts

hi firend i want a create image search engine 

like i want search tag "glasses"

its show me result reterive from my panel dir folders and sub folder

i try many code but not work for me..

like i have 100 folders in my dir and all folder have sub folder like ico png ok and pictures in these sub folder now

any one tell me which php code for reterive glasses name picutres from these folder

Link to comment
Share on other sites

i use this code its fine when i search in one dir like

<?php
$dir = 'test';
if($handle=opendir($dir.'/'))
{

while($file=readdir($handle))
{
if($file!='.'&&$file!='..')
{
echo '<img src="'.$dir.'/'.$file.'" width="250" hight="250"/><br>';
//echo '<a href="'.$dir.'/'.$file.'">'.$file.'</a><br>';
}
}
}
?>

but when i ad sub dir its show error like

 

$dir = 'test/png';
 

its show error

Warning: opendir(test/png/): failed to open dir

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.