[PHP] link generating script

2005-04-25 Thread Ed Dorsch



I'm scripting a 
photo gallery page that generates links (1 through $max), sends the selected 
number in the url, then displays a set of photos based on the number. However, I 
want it to display the number of the current gallery differently than the other 
numbers. If the browser clicks on "3" and is looking at gallery "page" three, 
then I don't want the number three to be a link -- and maybe it should be bolder 
or lighter or something. Any ideas? I was thinking of nesting an "if  then" 
inside the "for  next" but can't seem to make anything 
work.

Thanks,
Ed

THUMBNAIL GALLERY 
LINK GENERATING SCRIPT: Creates links 1 through 20, then sends the number chosen 
in the url. This number is used later to generate a different set of thumbnails 
for each selected page: 

$max=20;$max++;for ($n = 1; $n  $max; 
$n++){print' a 
href=""'.''.$n.'/a';}print 
' brbr';

Ed 
DorschDevelopment 
CommunicationsUniversity of Oregon541.346-0605 
"You can't wait for 
inspiration. You have to go after it with a club."-Jack London

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] array from folder

2005-04-25 Thread Ed Dorsch



Can PHP generate an 
array based on file names in a folder?

For example, if I 
have a folder called "photos" that includes three files -- tree.jpg, house.jpg 
and boat.jpg -- can PHP "look" at the file and generate a variable $photos= 
array("tree", "house","boat"). Any ideas for how to "sniff" out a folder 
to determine how many files are in it and then create an array with the file 
names in it?

Thanks,
Ed

Ed 
DorschDevelopment 
CommunicationsUniversity of Oregon541.346-0605 
"You can't wait for 
inspiration. You have to go after it with a club."-Jack London

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php