it will beCode:echo "<image src=\"$dir/$filename\"height=\"50\" \"width=\"50\"\><a href=\"$dir/$filename\"> $filename</a> ";
Code:echo "<img src=\"$dir/$filename\"height=\"50\" \"width=\"50\"\><a href=\"$dir/$filename\"> $filename</a> ";
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?
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\">$filename</a> "; } closedir($dir_list);
it will beCode:echo "<image src=\"$dir/$filename\"height=\"50\" \"width=\"50\"\><a href=\"$dir/$filename\"> $filename</a> ";
Code:echo "<img src=\"$dir/$filename\"height=\"50\" \"width=\"50\"\><a href=\"$dir/$filename\"> $filename</a> ";
wrong again here is the correct and working one
Code:$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\"> $filename</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!!
<span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">[Only registered and activated users can see links. Click Here To Register...]</span></span>
[Only registered and activated users can see links. Click Here To Register...]
<div class='quotetop'>QUOTE (rukiya @ Oct 13 2008, 11:39 PM) [Only registered and activated users can see links. Click Here To Register...]</div>there is the errorit will beCode:echo "<image src=\"$dir/$filename\"height=\"50\" \"width=\"50\"\><a href=\"$dir/$filename\"> $filename</a> ";
[/b]Code:echo "<img src=\"$dir/$filename\"height=\"50\" \"width=\"50\"\><a href=\"$dir/$filename\"> $filename</a> ";
$dir/$filename\"height=\"50\" \"width=\"50\"\
Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!
<span style="color:#9ACD32"><span style="font-size:36pt;line-height:100%">[Only registered and activated users can see links. Click Here To Register...]</span></span>
[Only registered and activated users can see links. Click Here To Register...]
Code:echo "<img src=\"$dir/$filename\" height=\"50\" width=\"50\"alt=\"Image\"/><a href=\"$dir/$filename\"> $filename</a> ";
Visit: [Only registered and activated users can see links. Click Here To Register...]
Visit: [Only registered and activated users can see links. Click Here To Register...]
_______
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...
_______
Info & Tips
php.net
w3schools.com
guys its still repeating 1 blank image with every pic i put in the wallpapers folder heres a screenshot of what i meanCode:http://andyj.biz/screenshotofimagesscript.bmp
<div class='quotetop'>QUOTE (andyjay30 @ Oct 14 2008, 04:50 PM) [Only registered and activated users can see links. Click Here To Register...]</div>try this ;)guys its still repeating 1 blank image with every pic i put in the wallpapers folder heres a screenshot of what i mean[/b]Code:http://andyj.biz/screenshotofimagesscript.bmp
Code:$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\"> $filename</a> "; } } closedir($dir_list); }else{ echo "whatever and next"; }
i see what you tryin to do here.
You tryin to add dir and its pickin up a error with the .
Visit: [Only registered and activated users can see links. Click Here To Register...]
Visit: [Only registered and activated users can see links. Click Here To Register...]
_______
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...
_______
Info & Tips
php.net
w3schools.com
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks