I tried to inject some PHP into a javscript function that is called from onChange in a drop down list. the javascript function is in the .js file, I can force the DDL to call the function, however I cannot make this function work with php ... in the end I am going to use the value selected in DDL to access the DB and fill in other fields from there, right now I'm trying to get it to work with php:
function controllerType(){
alert('outside php');
<?php
$message = "inside php";
echo "alert('$message');";
?>
}
The function prints the first warning, but not the warning called in php.
source
share