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.
I tried to save javascript code to php variable this way but got errors:
$parameter = "<script language='JavaScript'>document.write(geoip_country_name());</script>";
For echo this javascript code from database I was thinking to use that way:
$parameterecho = htmlentities($parameter);
echo $parameterecho;
Is there any better solution to echo code to page and how to save code to php variable?