Hi everyone,
I have a CGI script which performs a fair bit of work and I want to stop it running if the user closes their browser or hits back etc.
It's pretty easy in asp, as I could use Response.isClientConnected
Take a look at the following code:
Is it possible? Any help would be greatly appreciated....
I have a CGI script which performs a fair bit of work and I want to stop it running if the user closes their browser or hits back etc.
It's pretty easy in asp, as I could use Response.isClientConnected
Take a look at the following code:
Code:
print "Content-Type: text/html\n\n";
while ($recordExists) {
# HERE I WOULD LIKE TO CHECK IF THE CLIENT IS CONNECTED OTHERWISE TERMINATE SCRIPT
my $recordData=getRecordData();
print "Data: ${recordData}<br>";
$recordExists=isThereAnother();
}
print "Done!";
exit;
Is it possible? Any help would be greatly appreciated....