You are here: Re: Building thumbnail page (mysql) « PHP Programming Language « IT news, forums, messages
Re: Building thumbnail page (mysql)

Posted by Krustov on 10/28/06 14:38

<comp.lang.php>
<Krustov>
<Sat, 28 Oct 2006 15:00:49 +0100>
<MPG.1fad72d49049c05b98a123@news.newsreader.com>

> Its usually better to scan the folder for image files , The following
> doesnt create the thumbnails for you - but it will get you started .
>

The following php code being a bit better as it will only display files
that have the .jpg extension .


<?php

$batman=0;

$dir="chatroom/images";
$joker=opendir($dir);
while (false!==($boywonder=readdir($joker)))
{
$files[]=$boywonder;
$batman=$batman+1;
}

$temp=0;
while ($temp<$batman)
{
$demo=$files[$temp];

$riddler=strlen($demo);
$penguin=substr($demo,$riddler-4,4);

if ($penguin==".jpg")
{
$link="$dir" . "/" . "$demo";
print "<a href=$link>$demo</a><br>";
}

$temp=$temp+1;
}

?>


--
www.phpchatroom.co.uk

 

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

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