i have a problem when trying to include php with javascript
i have an:
if(document.getElementById(acheckbox).checked==true){
<?php $result=$result."bar-";?>
}
else{
<?php $result=$result."none";?>
}
but both are executed…
so $result is>>>bar-none
how can i solve this problem???
please help!
That JavaScript code, while it’s in a source file on your server, is just plain text to output.
It’s not code that’s executed by the PHP interpreter.
Both pieces of PHP code will always run.