You are here: Re: Displaying Images form a Directory « PHP Programming Language « IT news, forums, messages
Re: Displaying Images form a Directory

Posted by Jameson on 10/06/60 11:36

Hi Jim:

Sure, I'd be happy to keep looking into this. Maybe we'll end up
getting it to work.

First off, I am doing this on a Mac. Apache comes built in to OS X (I
believe as a service), and I installed PHP from an install package.

There is a PHP ini file on the Mac, although I've never had to edit it.
I used to run a Windows 2000 server with PHP on it, and I had to edit
the PHP.ini file quite a few times.

Restarting Apache on the Mac can either be done through the command
line or System Preferences. I tend to do it from the GUI, but I think
that "apachectl restart" will restart it from the command line.

There was actually something that I was wondering about your last
version of the script. If we take a look at it...

<?php
$dir = '.';
$sAltText = "Picture";
foreach (glob("*.jpg") as $file) {
echo "file: $file<br />\n";
echo "<i>filename:</i> <b>$file</b>, <i>filetype:</i> <b>" .
filetype($file) . "</b><br />\n";
echo '<img src="' . $file . '" border="0" alt="$sAltText" /><br />' .
"\n";

}

?>

....Let's say we set the directory to $dir = '/Users/jray/Pictures'; (a
path that I can browse to just fine from the command line). Where is
the $dir variable used in the rest of the script? If a directory is
specified in the glob() function, I believe it just defaults to the
directory that the script is in. Did you have a different experience on
your end?

Thanks again for sticking with this. Sometimes is is good to have an
understanding of how a function works across different operating
systems.

Jameson

 

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

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