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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-02 11:30:09
Original
1200 people have browsed it

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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template