I would like to place some JavaScript into a PHP snippet and be able to load a function. I have been following this site: http://www.dynamicdrive.com/forums/showthread.php?41129-How-to-put-JS-in-PHP and have had no luck.
This is my code so far:
<input type="hidden" name="projectPhoto" value='<?php echo "<script type=\"text/javascript\" src=\"js\phpjs.js\"></script>";
?>'/>
Despite following instructions clearly, the result is exactly what is being echoed. The script has not been run. Is this even possible to do?
Also this is my function:
function uploadFile(){
var filename = document.getElementById("image").value;
filename = filename.replace("C:\\fakepath\\", "");
alert(filename);
filename = String(filename);
document.getElementById("projectPhoto").value = filename;
};