title: Reading all file contents from a directory - php
body: <p>This is actually is an easy task</p>
  <p>I want to display contents of all files located in specified folder.</p>
  <p>I am passing directory name</p>
  <pre><code>echo &quot;&lt;a href='see.php?qname=&quot;. $_name .&quot;'&gt;&quot; . $row[&quot;qname&quot;] . &quot;&lt;/a&gt;&quot;;
  </code></pre>
  <p>on second page ,</p>
  <p>I am iterating over the directory content</p>
  <pre><code>while($entryname = readdir($myDirectory)) 
  {
              if(is_dir($entryname))
              {
                  continue;
              }   
              if($entryname==&quot;.&quot; || $entryname==&quot;..&quot; )
              {}
              else
              {
                  if(!is_dir($entryname))
                  {   
                      $fileHandle=fopen($entryname, &quot;r&quot;);
                      
                      while (!feof($fileHandle) ) {
             $line = fgets($fileHandle);
             echo $line . &quot;&lt;br /&gt;&quot;;
          }
  </code></pre>
  <p>.
  .
  .</p>
  <p>but I am unable to read any file , I have changed their permissions as well.</p>
  <p>I tried putting directory name statically which worked,
  Can someone suggest what am I doing wrong?</p>