In my root directory, I have a folder named 'd'. Without going into semantics, it simply stands for "Downloads".
Having said that, I have a function which is included on my resume page of the following code:
For the life of me, I cannot seem to grasp why I continually fail to make the function look in the folder 'd'. I'm thinking it's because of the way I have the $dir setup, but what other way is there?PHP Code:function pdfGen1(){
$active = basename($_SERVER['PHP_SELF']);
$dir = './d/';
if ($handle = opendir($dir)){
echo '<ul>';
while(false !== ($file = readdir($handle))){
if(substr($file,-4) == '.pdf'){
$displayName=ucfirst($file);
echo'<li><span class='.$spanClass.'><a href="'.$file.'">'.$displayName.'</a></span></li>';
}
elseif(substr($file,-4) == '.doc'){
$displayName=ucfirst($file);
echo'<li><span class='.$spanClass.'><a href="'.$file.'">'.$displayName.'</a></span></li>';
}
}
echo '</ul>';
closedir($handle);
}
}









Bookmarks