Hi,
I have a little trouble with passing an array variable (say $file_names) from one function to another. Lets look in more details:
I have following funcitons:
-
get_thumbs - to get the list of images in specific directory
-
display_thumbs - to display them in ordered way
-
display_large - to display larger image selected by user
During
get_thumbs function goes through a specified directory and writes all filenames of images in an array.
The end of the get_thumbs states : return($file_names)
And the definition of function display_thumbs is following:
function display_thumbs ($file_names) {
Then, this functions displays all of the thumbnails, generate a link of a larger image for each of it, by awarding an
id that corresponds to its place in array.
Afterwards, when user clicks on image, the
display_large function is called, and the same array ($file_names) is passed along. BUT, the display_large function does not recieve it! At the same time, the
id variable is passed!
Here is the way, the functions are called, basing on URL action variable:
As i guess, than there might be something wrong with the break operations after each case.
I hope that my explanation is clear enough to get the idea. I would really appreciate your help, as i do not need any code sample, but rather an idea of what might be wrong!
Kaspars