Ok gurus, I need your help once again.
This time I am up to no good. Well, it is good so yeah. Anyhow, What I want to do is use some code to pull every image in a directory and display it on a page. I am attempting to do this using the glob function. Problem is, it is wanting to put index.php before my image directory and that breaks the images obviously. if I use the old ../ trick, the page goes blank. If I try to hard code the entire url (which i know is not right and not to do but for testing), same thing, page goes all blank. I have even tried to , even though I knew better, to use use the old php echo url thing and no such love, once again, blank page.
Can you please take a peak at my code and let me know if anything stands out at you?
\<?php $files = glob("./lib/signatures/background/\*.\*"); for ($i=0; $i\<count($files); $i++) { $image = $files[$i]; print $image ."\<br /\>"; echo '\<img src="'.$image .'" alt="Profile Badge" /\>'."\<br /\>\<br /\>"; }
notice i added a single ./ ? That does NOT make the page go blank but instead it displays this:
./lib/signatures/background/background.png
./lib/signatures/background/background2.png
Now If I am trying to reinvent the wheel, please feel free to call me out on it. I can take it. If there is an easier way to pull off what I want to do, by all means please do crack me up side the head and say listen up Ray. Maybe this little lesson will enrich us all in a new style of doing things or even a page to use on our va website. I think the one thing phpVMS has always lacked was the preview badge feature. It has aggravated me more than once.
Esentially what this is supposed to do is, if a VA has a vast number of sig badges, say 20 for argument sake, well all we can do as pilots is pick a image name and save and hope we picked a good badge. With this code, there would be a link right next to where one chooses the badge while editing profile that would take them to a created page of my choice , badge_options or what ever and on this page, it would pull every image and display it in list fashion, non clickable. And once a pilot see the badge that he or she so chooses to use, they click the back to profile link and bingo bango, they choose their badge and all is well in the neighborhood.
If I right click on where it says Profile Badge, it give me the entire url to my site including index.php in front of the directory. http://XXXXXXXX/XXXXXXXX/index.php/lib/signatures/background/background2.png
Thanks for taking a look at my post. I appreciate it.