28, May 2012

readdir prob - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: readdir prob
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: readdir prob  (Read 941 times)
Where are my glasses?
*
Posts: 22
212 credits
Members referred : 0



« on: Aug 30, 2005, 06:29:06 pm »

I have this code :

Code:
<?php
$dh
=opendir('dir_name');

while(
false !== ($file=readdir($dh) ) )
{
if( 
is_file($file) )
    echo
"file";
else
    echo
"dir!"
}
?>


Can you help me make it work?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #1 on: Aug 30, 2005, 06:53:06 pm »

Here you are :

Code:
<?php
$dh
=opendir('dir_name');

while(
false !== ($file=readdir($dh) ) )
{
if( 
is_file('dir_name' $file) ) //The prob was here
    
echo"file";
else
    echo
"dir!"
}
?>

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=55
Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: readdir prob
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 07:30:49 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.