I’m a relatively light JavaScript user, so this minor operation is giving me some major grief — I’m sure I’m missing something.
All I want is a popup to open, passing one value — the emplogin, a string variable called getEmp — to a bog-standard .php page thusly:
<script type="text/javascript">
function getEmployeeInfo(getEmp)
{
window.open ("../Pages/Employee_Info.php?emplogin=" + getEmp + ",\"mywin\",\"menubar=0,resizable=1,scrollbars=1,width=600,height=450\"");
}
</script>
And it works… sort of. Testing the result by looking at the resulting $_REQUEST object shows me that the page is receiving the $emplogin as
Array
(
[emplogin] =>JohnDoe,"mywin","menubar=0,resizable=1,scrollbars=1,width=600,height=450"
)
IOW, the second and third parameters for Window.Open() are being passed along as part of the $emplogin received by PHP, instead of being parsed by JavaScript! (I’m using ‘echo htmlspecialchars(print_r($_REQUEST, true));’)
I’m sure there’s something I’m not doing right with the escaping of the parameters but I haven’t been able to hit on the right search terms. Thank you for any and all guidance!
Try this: