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();
?>