Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 16th, 2005, 01:46 PM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default popup problem

I have problem with my popup window

Code:
//IT LOOKS LIKE THIS BUT I WANT A SCRIPT THAT CAN UPDATE THE DATABASE AFTER THE POPUP HAS BEEN CLOSED.
I HAVE TRIED TO USE ONUNLOAD BUT IT DOES NOT WORK BECAUSE I HAVE A FORM IN THE POPUP 

Can Somebody give me a script that may work

or should I give up  this thing? 

<script type="text/javascript" language="JavaScript">
var msg;
function WinOpen() {
  msg=open("","displayWindow","toolbar=no,director
ies=no,menubar=no,width=60, height=60 );
 if (msg == null) alert('Popup was blocked');
msg.document.write("<HEAD><TITLE>yo!</TITLE&g
t;</HEAD>");
msg.document.write("<html><head><title>Unt
itled Document</title>");
msg.document.write("</head>");
msg.document.write("<frameset rows='*,225' cols='*' framespacing='1' frameborder='1' border='1' >");
msg.document.write("<frame src='/chat.php' name='mainFrame' > ");
msg.document.write("<frame src='send.php' name='bottomFrame' ></frameset>");
msg.document.write("<noframes><body></body>
;</noframes></html>");
msg.focus();
        }
<SCRIPT>

//open.php
<?
<form>
<input type="button" name="Button1" value="Open " onclick="WinOpen()">
</form>
?>

//FILE2
echo"<form method=\"post\" action=\"quit.php\" target=\"_top\">
<input type=\"submit\" name=\"Submit\" value=\" Log off! \">
</form>";



//I WANT THIS SCRIPT TO EXECUTE THIS SCRIPT EVEN WHEN THE WINDOW IS CLOSED

//quit.php
<?php
$sql1="UPDATE chat SET users='0' WHERE id='$id'";
$result1 = pg_query($sql1);
if(file_exists("message.txt")){
$filnamn ="message.txt";
unlink($filename);
session_unset();
session_destroy();
?>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in closing the parent window from a popup rakesh.kashnia1 Javascript 4 July 9th, 2007 05:39 AM
Popup problem ppayal ASP.NET 1.0 and 1.1 Professional 1 July 21st, 2006 07:05 AM
Problem with closing popup fs22 Javascript 4 May 20th, 2004 09:37 AM
problem with Popup tgopal Javascript 4 October 29th, 2003 08:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.