|
Posted by juglesh on 10/17/62 11:34
patrick_woflian wrote:
> hey guys. okay... this may seem confussing to you but im in desperate
> need of help!! basically i have a list of images in a directory called
> 'pictures'.. and i was hoping to show them on a web page by the
> following code:
You gots to look at the html that is produced by this code, and see if
it makes sense:
> <?php
>
> $handle = opendir('pictures');
>
> if($handle) {
>
> while(false !== ($file = readdir($handle))) {
>
> if(preg_match("/\w+(.jpg)/",$file)) {
>
> print"<a href='pictures'>"$file"</a>";
So where is this link supposed to go? Maybe you wanted "<a
href='pictures.htm'>"?
>
>
> print "$file <br>";
Did you want this to print the actual image, or just the name of it?
If you want to see the image, you would do like:
print "<img src='myImageDir/$file'>";
--
juglesh
Navigation:
[Reply to this message]
|