oasmar Posted June 21, 2007 Share Posted June 21, 2007 Hey Guys, i have tried to make a Directory browser for Website, it is for admins to edit pages. I want to it have two seperate links, one for directorys and one for files. $dir = $_GET['path']; if(!$_GET['path']){ $dir = $sitedir; } echo "<div align=\"left\"><h1>Directory:</h1>"; $dh = opendir($dir); while (($file = readdir($dh)) !== false) { if ($file == "." || $file == ".." ) { }else{ if(is_dir($file)){ // if it is a directory i want it to use this link echo "<a href='$_SERVER[php_SELF]?dir=fileeditor&path=$dir$file/'>$file</a><br />"; }else{ // if it is a file i want it to use this link echo "<a href='$_SERVER[php_SELF]?dir=fileeditor&file=$dir$file'>$file</a><br />"; } } } closedir($dh); As you can see i have tried to use the is_dir but this hasnt worked. Please help! Link to comment https://forums.phpfreaks.com/topic/56588-help-with-a-directory-browser/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.