Javascript code in php variable
<p>I want to put javascript code to php variable, after that save it to mysql database and after that echo it on page. I have problem with save javascript code to php variable and echo it on page.</p>

<p>I tried to save javascript code to php variable this way but got errors:</p>

<pre><code>$parameter = "&lt;script language='JavaScript'&gt;document.write(geoip_country_name());&lt;/script&gt;";
</code></pre>

<p>For echo this javascript code from database I was thinking to use that way:</p>

<pre><code>$parameterecho = htmlentities($parameter);
echo $parameterecho; 
</code></pre>

<p>Is there any better solution to echo code to page and how to save code to php variable?</p>
