PHP Variable in Echoing JavaScript
<p>I have an php script that is echoing JavaScript, in the JavaScript there are PHP variables </p>

<pre><code>echo '&lt;script type="text/javascript"&gt; 
     FB.init({
    appId: "myid",
    channelUrl: "//mysite/channel.html",
    status: true, // check login status
    cookie: true, // enable cookies to allow the server to access the session
    xfbml: true // parse XFBML
});
FB.getLoginStatus(function (response) {
    if (response.status === "connected") {
        FB.api("me/bookvote:download", "post", {
            book: "&lt;?php echo "http://mysite/auction_details.php?name=$item_details["name"]&amp;auction_id=$item_details["auction_id"]";?&gt;",
            fb:explicitly_shared = "true" //? Is syntactically valid but creates a global
        }, //Missing a , here?
</code></pre>

<p>However, I am still getting: </p>

<pre><code>Uncaught SyntaxError: Unexpected identifier for book: http://mysite.xom/auction_details.php?name=$item_details["name"]&amp;auction_id=$item_details["auction_id"]";?&gt;",
</code></pre>

<p>What should I do?</p>
