首頁 >後端開發 >php教程 >mysql-PHP+MYSQL,注销时,保存最后登陆的IP及时间,代码为何未生效?

mysql-PHP+MYSQL,注销时,保存最后登陆的IP及时间,代码为何未生效?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-06-02 11:30:091193瀏覽

mysqlphp

<code>//-----------注销begin------------------------------------------if ( $_GET['action'] == "logout" ){    //注销前,记录最后一次成功登陆的IP及日期    include('conn.php');    $client_ip = $_SERVER["HTTP_CLIENTIP"];    $user_id = $_SESSION['user_id'];    echo $client_ip;    echo $user_id;    sleep(10);    mysql_query("update users SET user_last_log_ip = $client_ip,user_last_log_date = unix_timestamp(now()) where user_id = $user_id limit 1");    mysql_close($con);     //删除SESSION    unset($_SESSION['user_id']);    unset($_SESSION['user_email']);     unset($_SESSION['user_nickname']);     echo '<br>'.'注销成功!';    exit;}</code>
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn