On Tue, 26 Mar 2002, Jason Goodman wrote:
> 2 questions about register_shutdown_function.
> 
> 1)Functions registered with register_shutdown_function are called after
> the script finishes processing.  Is there a way to have a function only
> called when the PHP form is actually closed?
> 
> 2)The function registered with register_shutdown_function does not seem
> to write to a file before the PHP page is closed.  I need to send a
> message to another file when the PHP form is closed.

When you say "when the PHP form is closed" do you mean when the user has
finished looking at the page on their browser and moves on to something
else by clicking their mouse? Because there's not particularly a way to do
this. The connection between PHP script and browser is finished before
anything even displays in the browser window (unless you're flushing the
output buffer, but that doesn't help you any).

You could attach some JavaScript to the page that looks for window closure 
and away-clickery and then sends your server a request for a PHP file in 
response, but that's outside the scope of this list (it's a JavaScript 
problem).

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to