tags:

views:

27

answers:

3

hi i want to ask...how can i break the connection of user to internet used php script...... thanks

A: 

And why the ruby tag? :)

Php is a server-side language, if you need to perform client-side actions you need to use a client-side language. Javascript or VBScript to name a few.

Romain Deveaud
+1  A: 

Take a look at Connection Handling!

http://www.php.net/manual/en/features.connection-handling.php

if(connection_status() == 1 || connection_status == 2) // Timeout or Abort
{
   //Skip the DB shizzle
}else
{
   $DB->inserter->user('john','doe','password');
}
RobertPitt
...interesting. Thanks for the reference. But note that it only comes into play if `ignore_user_abort` is enabled, and that it's just for polling the status, not changing it.
grossvogel
why would you want to change the status if the user has disconnected, theres no point in forcing content out if the user is no longer connected!
RobertPitt
A: 

Are you looking for exit()? This will stop script execution. The server will finish up the response, and the connection will be closed.

http://us.php.net/manual/en/function.exit.php

grossvogel