directories and variables

General discussions related to php

Moderators: macek, egami, gesf

jasonfarrell
New php-forum User
New php-forum User
Posts: 4
Joined: Thu Jul 10, 2003 11:34 am

directories and variables

Postby jasonfarrell » Thu Jul 10, 2003 5:04 pm

what this does is add a line of a javascript and i'm having trouble figuring out a few things. everything works fine, except i do not know how to make the $trufls variable equal the word "True" when there is a directory within the directory. then i need to make $Q be what level it is in the directory. if its the first directory its 0, if its the 2nd, its 1, etc. then i need to only show $dir/$f when there is an index.html in the root folder.


function finddirs($dir)
{ $d = opendir($dir);
$files = array();
while($f = readdir($d))
if($f != "." && $f != "..")
$files[] = $f;
closedir($d);
foreach($files as $f)
if(is_dir("$dir/$f"))
{
echo 'dbAdd( '.$trufls.' , "'."$f".'" , "'."$dir/$f".'" , '.$Q.' , "main", 0);';

finddirs("$dir/$f");
}
}
finddirs(".");

User avatar
WiZARD
Moderator
Moderator
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Re: directories and variables

Postby WiZARD » Fri Jul 11, 2003 1:19 am

if (!$Q and $Q=='') $trufls="false" else $trufls="true";


Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 2 guests