Problem With Image Display

Started on the old forum in October 2008 · view the original in the archive · old links redirect here

7 replies · 548 views · started 18 years ago · 1 min read

4 participants
Guest #1

im having a weird problem this script is supposed to list files in a dir which in this case images i got t to display the images but i keep getting 2 blank images at the top its like its repeating can any one suggest what i have done wrong with this code?

$dir="wallpapers"; // Directory where files are stored
if ($dir_list = opendir($dir))
{
while(($filename = readdir($dir_list)) !== false)
{
echo "<image src=\"$dir/$filename\"height=\"50\" \"width=\"50\"\><a href=\"$dir/$filename\">[b]$filename[/b]</a>

";
}
closedir($dir_list);
learner Lead · 587 posts #3

wrong again here is the correct and working one

$dir="wallpapers"; // Directory where files are stored
if ($dir_list = opendir($dir))
{
while(($filename = readdir($dir_list)) !== false)
{
echo "<img src=\"$dir/$filename\" height=\"50\" width=\"50\"/><a href=\"$dir/$filename\">[b]
$filename[/b]</a>

";
}
closedir($dir_list);
}else{
///whatever and next
}

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

learner Lead · 587 posts #4

QUOTE (rukiya @ Oct 13 2008, 11:39 PM) <{POST_SNAPBACK}>

echo "<image src=\"$dir/$filename\"height=\"50\" \"width=\"50\"\><a href=\"$dir/$filename\">
$filename</a>

";

it will be

echo "<img src=\"$dir/$filename\"height=\"50\" \"width=\"50\"\><a href=\"$dir/$filename\">
$filename</a>

";

there is the error $dir/$filename"height="50" "width="50"\

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

subzero Super moderator Fellow · 3,954 posts #5
echo "<img src=\"$dir/$filename\" height=\"50\" width=\"50\"alt=\"Image\"/><a href=\"$dir/$filename\">[b]
$filename[/b]</a>

";

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Guest #6

guys its still repeating 1 blank image with every pic i put in the wallpapers folder heres a screenshot of what i mean

http://andyj.biz/screenshotofimagesscript.bmp
djdeny Junior · 12 posts #7

QUOTE (andyjay30 @ Oct 14 2008, 04:50 PM) <{POST_SNAPBACK}>

guys its still repeating 1 blank image with every pic i put in the wallpapers folder heres a screenshot of what i mean

http://andyj.biz/screenshotofimagesscript.bmp

try this 😉

$dir="wallpapers"; // Directory where files are stored
if ($dir_list = opendir($dir))
{
while(($filename = readdir($dir_list)) !== false)
{
if($filename!="." AND $filename!="..")
{
echo "<img src=\"$dir/$filename\" height=\"50\" width=\"50\"/><a href=\"$dir/$filename\">[b]
$filename[/b]</a>

";
}
}
closedir($dir_list);
}else{
echo "whatever and next";
}
subzero Super moderator Fellow · 3,954 posts #8

i see what you tryin to do here.

You tryin to add dir and its pickin up a error with the .

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close