PHP / Javascript Question
Posted: Sat Nov 13, 2010 4:34 pm
Running PHP5 on Ubuntu and some code using javascript fails. It worked at one time but updates to Ubuntu may have caused it to fail. I can't find what has changed that may be causing the problem.
This code in the program works:
<script type="text/javascript">
function redirect() {
window.location="<?php echo $_SERVER['PHP_SELF']; ?>";
}
</script>
This code in the same program does NOT:
function confirm($msg) {
echo "<script langauge=\"javascript\">alert(\"".$msg."\");</script>";
}
The alert box is partially displayed but the data in $msg is not. The space for the msg is void.
Does anyone have any suggestions?
This code in the program works:
<script type="text/javascript">
function redirect() {
window.location="<?php echo $_SERVER['PHP_SELF']; ?>";
}
</script>
This code in the same program does NOT:
function confirm($msg) {
echo "<script langauge=\"javascript\">alert(\"".$msg."\");</script>";
}
The alert box is partially displayed but the data in $msg is not. The space for the msg is void.
Does anyone have any suggestions?