This should work
PHP Code:
// ########################## phpchat off ########################
if ($action=="phpchatsysoff") {
include("./global.php");
$DB_site->query("UPDATE user SET phpchatsys=0 where userid='$bbuserinfo[userid]'");
$goto="usercp.php?s=$session[sessionhash]";
eval("standardredirect(\"".gettemplate("redirect_updatethanks")."\",\"$goto\");");
} #end phpchat off