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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.