php - List Dir not functioning as expected -
i have used usercake make login system, altering suit needs.
originally list dir setup on page show of "help files" within specific folder. worked fine not secure , view. have changed security having few problems code:
//links logged in user if(isuserloggedin()) { //links permission level 3 (bof) if ($loggedinuser->checkpermission(array(3))){ if ($handle = opendir('cd500/')) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..'){ $thelist .= '<a href="/cd500/'.$file.'' target='_blank' >'.$file.'</a></br>'; } } closedir($handle); } echo " <div id='output'> list of files:</div> <div id='list'> $thelist
this whole completed package. wondering if simple many if statements?
it not parse, html loads , images appear never materializes.
i set up:
//links logged in user if(isuserloggedin()) { //links permission level 3 (bof) if ($loggedinuser->checkpermission(array(3))){ foreach(glob('./bof/*.*') $filename){ echo $filename ; } }
my problem whilst works, make presentable have far failed do.
i ideally fix first solution, if not how can style second?
this line
$thelist .= '<a href="/cd500/'.$file.'' target='_blank' >'.$file.'</a></br>';
should be
$thelist .= '<a href="/cd500/'.$file.'" target="_blank" >'.$file.'</a></br>';
Comments
Post a Comment