Jump to content

HELP


ZulfadlyAshBurn

Recommended Posts

i have this code to show all the files in the users folder

<?PHP

session_start();

if(!isset($_SESSION['myusername'])){
header("location:index.php");
}
else {
$buildhtml = "";
$dirpath = "u/"  . ($_SESSION['myusername']) . "/"; 
$dlist = opendir($dirpath); 
while ($file = readdir($dlist)) { 
if (!is_dir("$dirpath/$file")) {
$buildhtml .= "<tr><td><a href=$dirpath$file>$file</a></td>
<td> | <a href=edit.php?filepg=$file>Basic Editor</a> / <a href=edit1.php?filepg=$file>Advanced Editor</a> | </td>
<td><a href=delete.php?fileitem=$file>*delete</a> | </td>
<td><a href=rename.php?filepg=$file>*rename</a></td></tr>";  
} 
} 
closedir($dlist); 

if (!empty($buildhtml)) {
echo "Files in Storage</strong><table border='0'>
<tr>
<th>Filename</th>
<th>Edit</th>
<th>Delete</th>
<th>Rename</th>
</tr>" . $buildhtml . "</table>";
echo "Click on it to download<br>";
echo "Notice: Only html/txt files are editable";
} else {
echo "The folder is <strong>empty</strong>! Please upload!.";
}
}
?>

its shows everything correctly. but if the file have space, it will just link to the first word. how do i enable the spaces?

Link to comment
https://forums.phpfreaks.com/topic/227063-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.