bradgrafelman.
Yup, you got it. The idea of the two game pages (one with js and one without) was going to be my backup plan. However, since posting, I think I've come up with a solution. The codes below. The only problem I have now is that when the php page is invoked, it replaces the game page and when I close the wrong answer popup (with a button), I'm left looking at a blank page.
If I could fix that problem, I'd be a very happy camper.
Any ideas?
code:
<?php
$answer = "Satsumi";
if ($answer != $_POST[Guess]) {
echo "
<script>
function popitup2() {
newwindow2=window.open('','name','height=300,width=400,screenX=312,screenY=234');
var tmp = newwindow2.document;
tmp.write('<html><head><title>popup</title>');
tmp.write('</head><body><p><center>');
tmp.write('<font face=andy size=8>I'm Sorry.<p>That's Incorrect.<p>Please try again.');
tmp.write('<p><input type=button value=Try Again onclick=window.close()>');
tmp.write('</body></html>');
tmp.close();
}
</script>
<body onload='javascript: popitup2()'>
</body>
</html>
";
}
else {
echo "<script>window.location='winner.html'</script>";
}
?>