Can you tell me why I don't get a POST message in this code?
test.htm:
<html>
<head>
<title></title>
<script language="Javascript" type="text/Javascript">
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
if(popUpWin)
{
if(!popUpWin.closed) popUpWin.close();
}
popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
</script>
</head>
<body>
<script language="JavaScript">
popUpWindow("test2.htm", 100, 100, 200, 200);
</script>
</body>
</html>
Test2.htm:
<html>
<head>
<title></title>
</head>
<body>
<form name = "test" method="post" action="add.php">
<label>this is the message<br />this is also a message.</label>
<input type="hidden" name="hiddenfield" value="">
<a href="javascript:;" onClick="document.test.hiddenfield.value=1;document.test.submit();self.close();"><img src="images/OK.gif"></a>
</form>
</body>
</html>
add.php:
<?php
if (isset($_POST['hiddenfield'])) echo 'hiddenfield is set to '.$_POST['hiddenfield'].'<br \>';
else echo 'hiddenfield is not set';
?>