I have a program in PHP that allows user to pop in a message, for confir开发者_开发百科mation from user. As seen below is the link i used.
From inbox.php:
echo "<a href='inbox.php' onclick=\"popup('acknowledge.php?id=$id')\"><font size=1px color=maroon>acknowledge</font></a></td>";
From acknowledge.php:
if ($_POST['no']) {
header("location: inbox.php");
}
?>
<body bgcolor=skyblue>
<center><form name=form1 method=post>
<b><u> Acknowledge Message </u></b><br><br>
Are you sure yout want to acknowledge this message?<br><br>
<input type=button name=yes value="Yes">
<input type=submit name="no" value="No">
</form>
</center>
</body>
The problem is, everytime i click "no", to go back from previous page. It sets the page size the same as the popup page. It becomes smaller too. What's the problem? Answers are very much appreciated.
Here is the code for popup():
<script language="JavaScript" type="text/JavaScript">
<!-- function popup(url) {
var width = 500;
var height = 135;
var left = (screen.width - width)/2;
var top = (screen.height - height)/2;
var params = 'width='+width+', height='+height;
params += ', top='+top+', left='+left;
params += ', directories=no';
params += ', location=no';
params += ', menubar=no';
params += ', resizable=no';
params += ', scrollbars=no';
params += ', status=no';
params += ', toolbar=no';
newwin=window.open(url,'windowname5', params);
if (window.focus) {newwin.focus()}
return false;
}
// -->
</script>
Is it not because you are setting the url to the new win instead of the current window?
精彩评论