title: PHP within Javascript?
body: <p>I wanted to include some PHP inside of some Javascript code to edit a div's innerHTML. <br />
  When I use the code</p>
  
  <pre><code>$content = file($filename);
  $name = $content[0];
  &lt;script type="text/javascript"&gt;
  function showMoon1()
  {
  var MD = document.getElementById('m1t');
  MD.innerHTML = "&lt;font face='Georgia'&gt;&lt;table border="0"&gt;&lt;tr&gt;&lt;th&gt;&lt;?php echo $name; ?&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Rating: rating&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Review: review&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Category: category&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Link: &lt;a href='http://youtube.com'&gt;welcome&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/font&gt;";
  }
  &lt;/script&gt;
  &lt;div id="m1t"&gt;&lt;/div&gt;
  &lt;a href="#" onClick="showmoon1()"&gt;CLICK HERE&lt;/a&gt;
  </code></pre>
  
  <p>For some reason, When I click the "CLICK HERE" link, nothing happens. I edited the full code down to a short example, so I don't know if the error comes up. All I know is when I use a PHP variable with the <code>content[0];</code> code, it doesn't work. When I tried <code>$name = "hi";</code> It works. <strong>What?</strong> <br />
  <strong>Please don't vote this question down because it's specific. Thank you.</strong></p>