Reading in files from local disk in php
<p>I've downloaded files from my svn that are now stored on a document on my local disk. Most of these files are php files. How can I read in documents (that aren't "txt") which are located on my local disk and open them on a website that uses php. So so far this is what I have,</p>

<p>index.php</p>

<pre><code>&lt;script&gt;
$(function() {
    $('#getData').click(function(event) {
        event.preventDefault();

        $.ajax({
            type: "GET",
            url: "endPoint.php",
            data : { field2_name : $('#userInput2').val() },
            beforeSend: function(){
            }
            , complete: function(){
            }
            , success: function(html){
                //this will add the new comment to the `comment_part` div
                $("#displayParse").html(html);
                //$('[name=field1_name]').val('');
            }
        });
    });
});

&lt;/script&gt;


&lt;form id="comment_form" action="endPoint.php" method="GET"&gt;
    Enter the file you would like to view:
    &lt;input type="text" class="text_cmt" name="field2_name" id="userInput2"/&gt;
    &lt;input type="submit" name="submit" value="submit" id = "getData"/&gt;
    &lt;input type='hidden' name='parent_id' id='parent_id' value='0'/&gt;
&lt;/form&gt;

&lt;div id="displayParse"&gt;
&lt;/div&gt;
</code></pre>

<p>endPoint.php</p>

<pre><code>&lt;?php

$filePath = $_GET["field2_name"];
$url = "cs_data/home/" . $filePath;

$file = fopen($url, "r");
fread($file,filesize($url));

echo '&lt;div class="comment"&gt;' . $file . '&lt;/div&gt;';


?&gt;
</code></pre>

<p>basically the user inputs a file they want to open, and the files are located on my local disk. Not sure where I'm going wrong as the file contents are not being printed out and instead I'm getting this printed out "Resource id #3". Also I am running my code on localhost using MAMP. The IDE I'm using is phpstorm. I'm not sure if my documents need to be loaded onto phpstorm in order to access them</p>