tags:

views:

49

answers:

1

I have a program in PHP that allows user to pop in a message, for confirmation 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">
&nbsp;
<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>
A: 

Is it not because you are setting the url to the new win instead of the current window?

RenegadeAndy
Pardon me,I didn't quite get what you mean? The popup() function is inside my inbox.php, upon clicking, it will open the popup page (new win) named "acknowledge.php". But when i exit/cancel, by clicking "No" button, it returns to inbox.php (just what i wanted) but with smaller page size. :(
Suezy