How can I pass a php include call as a variable for javascript function?
<p>I have a page that use javascript innerhtml to replace the contents of an element as a pseudo-static page.</p>

<p>The following code is from the current content of that element:</p>

<pre><code>&lt;?php
$con = mysql_connect('***********', '******', '**********');
mysql_select_db(dbbmdmi);

if ($con) {
    $sql = "SELECT TeamID, Captain, CountryID, ArrDate, DepDate FROM Teams";
    $result = mysql_query($sql) or die(mysql_error());

    $link = "&lt;a id='" . $row["TeamID"] . "' onClick='SetTeamID();ReplaceContentInContainer('content','replace_target6')'&gt;Edit&lt;/a&gt;";

    if ($result) {
        // output data of each row
        while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
            echo "Captain: " . $row["Captain"]. "&lt;a id='" . $row["TeamID"] . "' onClick=\"ReplaceContentInContainer2('content','&lt;?php include 'scripts/editteam.php?TeamID=" . $row["TeamID"] . "'&gt;')\"&gt;Edit&lt;/a&gt;;" . "&lt;/br&gt;Country: " . $row["CountryID"]. "&lt;/br&gt;Dates: " . $row["ArrDate"]. " - ". $row["DepDate"]. "&lt;br&gt;";
        }
?&gt;
</code></pre>

<p>In <code>onClick=\"ReplaceContentInContainer2('content','&lt;?php include 'scripts/editteam.php?TeamID=" . $row["TeamID"] . "'&gt;')</code> I'm trying to pass the php include as the "source" argument to the following function in the original "container" page:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function ReplaceContentInContainer2(target,source) {
        document.getElementById(target).innerHTML = source;
    }
&lt;/script&gt;
</code></pre>

<p>I keep getting this error when I click the link:</p>

<blockquote>
  <p>teams.php:1SyntaxError: Unexpected identifier 'scripts'. Expected ')' to end a argument list.</p>
</blockquote>

<p>Basically, I'm trying to pass the <code>$row_["TeamID"] to the next page in the address so that I can call with a</code>$_GET` function.</p>

<p>Any suggestions?</p>

<p><strong>UPDATE:</strong></p>

<p>After escaping the single quotes in the javascript function call, the content of the element is replaced as it should be, except the php include is being rendered in the new content as an html comment, rather than run as php.</p>

<p>escaped single quotes in <code>onClick=\"ReplaceContentInContainer2('content','&lt;?php include \'scripts/editteam.php?TeamID=" . $row["TeamID"] . "\'?&gt;')\"</code></p>

<p>rendered html: <code>&lt;!--?php include 'scripts/editteam.php?TeamID=Kellog'?--&gt;</code></p>