This is actually an easy job. I want to display the contents of all the files located in the specified folder.
I pass the directory name
echo "<a href='see.php?qname=". $_name ."'>" . $row["qname"] . "</a>";
on the second page,
I write
while($entryname = readdir($myDirectory))
{
if(is_dir($entryname))
{
continue;
}
if($entryname=="." || $entryname==".." )
{}
else
{
if(!is_dir($entryname))
{
$fileHandle=fopen($entryname, "r");
while (!feof($fileHandle) ) {
$line = fgets($fileHandle);
echo $line . "<br />";
}
. ,.
but I can’t read any file, I also changed their permissions
I tried to put the directory name statically and it works, any solution?
source
share