Jump to content

How to when a window is closed run a script? or bring up a Java dialogue box?


jordz

Recommended Posts

Hey All,

 

I have a page on my website that takes the first item of the mysql table and sets the screen_id to 1.

 

//get the first currently in queue
$getfirst = "SELECT * FROM photos WHERE photo_id = '$screenphoto['photo_id']'  ORDER BY photo_id DESC LIMIT 0,1";
$querygetfirst =  mysql_query($getfirst);
$screenphoto = mysql_fetch_array($querygetfirst, MYSQL_ASSOC);

//change status

$progressset = "UPDATE photos SET screen_id=1 WHERE photo_id =". $screenphoto['photo_id'];
$inprogress = mysql_query($progressset);

 

However, what I want is to happen is that when the X button is hit to close the browsing window the screen_id be turned back to 0?

If the X button is clicked is there a way to run a part of the script before it closes? or even a java dialogue box that once okay is clicked is redirected to a new page?.

 

Thanks

 

Jordan

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.