PHP & Jquery - Sending data between the client and server
<p>I am trying to write code that sends a file path to the server, uses php to parse out each line into an array and returns the array to the client to have stuff done to it. </p>

<p>When I run my program it doesn't look like it is processing the php file as the echo that i put in for testing purposes is never called.</p>

<p>I know absolutely nothing about PHP so help is greatly appreciated!</p>

<p>Jquery:</p>

<pre><code>$("#codelines").load('ParsePHPForDisplay.php?filename=DBManager.php');

    console.log($('#codelines'));
    pieces = $("#codelines").html().split("\n");
</code></pre>

<p>PHP:</p>

<pre><code>&lt;?php

class Parsing
{
    function ParseStuff()
    {
        echo('hi');
        $parsedFile = file($_REQUEST['filename']);
        echo($_REQUEST['filename']);
//        foreach ($parsedFile as $parsedFile_num =&gt; $parsedFile) {
//            echo"Line #&lt;b&gt;{$parsedFile_num}&lt;/b&gt; : " .htmlspecialchars($parsedFile) . "&lt;br/&gt;\n";
//        }
        return $parsedFile;
    }
}

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

<p>A piece of my HTML:</p>

<pre><code>&lt;section id="codestuff"&gt;
    &lt;h2&gt;Code Lines&lt;/h2&gt;
    &lt;pre id="codelines"&gt;
    &lt;/pre&gt;
&lt;/section&gt;
</code></pre>

<p><strong>EDIT:</strong></p>

<p>Here is my PHP now:</p>

<pre><code>&lt;?php


        echo('hi');
        $parsedFile = file($_REQUEST['filename']);
        echo('test');
        echo($_REQUEST['filename']);
//        foreach ($parsedFile as $parsedFile_num =&gt; $parsedFile) {
//            echo"Line #&lt;b&gt;{$parsedFile_num}&lt;/b&gt; : " .htmlspecialchars($parsedFile) . "&lt;br/&gt;\n";
//        }
        return $parsedFile;



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

<p>I get this error:</p>

<p><b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_FUNCTION in <b>ParsePHPForDisplay.php</b> on line <b>5</b><br>.</p>
