ShadowHero
ShadowHero

Reputation: 153

Is there a way to force a server to stop executing a script?

I am sending an AJAX get() request and I want to be able to abort it. Using the AJAX abort() I can force the client to stop listening to the response. Is there a way to make the server stop executing the php script?

Upvotes: 0

Views: 222

Answers (1)

Jesper Blaase
Jesper Blaase

Reputation: 2400

You can use the function connection_aborted() to detect if the client is still connected and then die(), exit() or whatever if the client has.

Upvotes: 2

Related Questions