You are here: Re: [PHP] I need to create a search that will search partial filesnames of images and display the images. Basically, I have a folder on theinternet that has security camera images dumped into it with a file namelike this: « PHP « IT news, forums, messages
Re: [PHP] I need to create a search that will search partial filesnames of images and display the images. Basically, I have a folder on theinternet that has security camera images dumped into it with a file namelike this:

Posted by Vin on 10/04/48 11:07

"Marek Kilimajer" <lists@kilimajer.net> wrote in message
news:420261B7.4030305@kilimajer.net...
> Vin wrote:
> > I need to create a search that will search partial files names of images
and
> > display the images. Basically, I have a folder on the internet that has
> > security camera images dumped into it with a file name like this:
> >
> > MDcameraname20050109104846001N38B.jpg
> > MDcameranameYYYYMMDDHHMMSS001N38B
> >
> > So what I would like to create is a search that will allow a user to
input
> > the year, month, day, and hour, and have the website display the images
from
> > that hour. Could someone help me with this?
> >
> > Thanks in advance,
> > Vinny
> >
>
> http://sk2.php.net/manual/en/function.glob.php


thanks, that is perfect. Now I have a follow up question if you don't mind.
How can I take $filename and break it apart to display the time/date the
picture was taken in a nice readable format?

here is my code:

<?php
$x = 0;
$count = 0;
$matches = glob("*$y$m$d$h*.JPG");
if ( is_array ( $matches ) )
{
foreach ( $matches as $filename)
{
if ($x < 4)
{
echo "<td>";
echo "<a href=javascript:pop('";
echo $filename;
echo "');>";
echo "<img src='";
echo $filename;
echo "' border=0 width=240 height=180></a>";
$count = $count+1;
echo "<br>";
echo $filename;
echo "</td>";
$x = $x + 1;
} else {
echo "</tr><tr>";
$x = 0;
}
}
}

echo "<br><br>";
echo $count . " images found";
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация