I have a php page with javascript displaying php variable using alert. I am getting syntax error and not sure why.
The code is:
case "copyas":
// This code inserted by SS for confirming the copy before updating
echo "<script Language=\"JavaScript\" Type=\"text/javascript\">\n";
echo "<!--\n";
echo "var x=confirm('Do you want to copy from $copyfrom to $copyto');";
echo "if (!x);";
echo "window.location.href = 'http://www.contactsready.com/per_mod.php?op=$frompage';";
echo "else;";
echo "<?php copyas($uname,$frompage,$copyfrom,$copyto);?>;";
echo "end;";
echo "//-->\n";
echo "</script>\n";
I am getting a syntax error in the winow.location..... line.
note: $copyfrom and $copyto are php variables. copyas is a php function.
Please help
Sridhar