Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何存储登录详细信息,如登录时间和哪台机器(ip地址)_Php_Login - Fatal编程技术网

Php 如何存储登录详细信息,如登录时间和哪台机器(ip地址)

Php 如何存储登录详细信息,如登录时间和哪台机器(ip地址),php,login,Php,Login,我是php的初学者 我的php项目,后端sql 我有一个登录表单。我想维护活动日志。怎么做 这包括: 1.Login time Logout time 2. Machine Name(IP address) 3.status( sign in pass/fail) 提前感谢。您需要在此处使用php功能 这样做: 1.Login time Logout time $time = date('Y-m-d h:i:s'); 2. M

我是php的初学者

我的php项目,后端sql

我有一个登录表单。我想维护活动日志。怎么做

这包括:

         1.Login time Logout time

         2. Machine Name(IP address) 

         3.status( sign in pass/fail)

提前感谢。

您需要在此处使用php功能

这样做:

 1.Login time Logout time
 $time = date('Y-m-d h:i:s');

 2. Machine Name(IP address) 
 $ipaddr = $_SERVER['REMOTE_ADDR']

 3.status( sign in pass/fail)
 You need to check this using mysql query. 

请告诉我更多帮助。

您需要在此处使用php功能

这样做:

 1.Login time Logout time
 $time = date('Y-m-d h:i:s');

 2. Machine Name(IP address) 
 $ipaddr = $_SERVER['REMOTE_ADDR']

 3.status( sign in pass/fail)
 You need to check this using mysql query. 

请告诉我更多帮助。

您需要在此处使用php功能

这样做:

 1.Login time Logout time
 $time = date('Y-m-d h:i:s');

 2. Machine Name(IP address) 
 $ipaddr = $_SERVER['REMOTE_ADDR']

 3.status( sign in pass/fail)
 You need to check this using mysql query. 

请告诉我更多帮助。

您需要在此处使用php功能

这样做:

 1.Login time Logout time
 $time = date('Y-m-d h:i:s');

 2. Machine Name(IP address) 
 $ipaddr = $_SERVER['REMOTE_ADDR']

 3.status( sign in pass/fail)
 You need to check this using mysql query. 
请告诉我更多帮助。

解决了我的问题

用于获取具有计算机名称的ip地址的代码:

         <?php

         $machineName = gethostname();   //for get current system name 

         $ip = gethostbyname($machineName); //For get ipaddress

        ?>

解决了我的问题

用于获取具有计算机名称的ip地址的代码:

         <?php

         $machineName = gethostname();   //for get current system name 

         $ip = gethostbyname($machineName); //For get ipaddress

        ?>

解决了我的问题

用于获取具有计算机名称的ip地址的代码:

         <?php

         $machineName = gethostname();   //for get current system name 

         $ip = gethostbyname($machineName); //For get ipaddress

        ?>

解决了我的问题

用于获取具有计算机名称的ip地址的代码:

         <?php

         $machineName = gethostname();   //for get current system name 

         $ip = gethostbyname($machineName); //For get ipaddress

        ?>



谢谢。存储这些数据的“会话”、“cookies”或“mysql”哪种方式更好?我认为
mysql
as
session
cookie
会在某个时候被删除。是的。我在其他帖子中读到过这样的内容。我认为最好保存在数据库中。困惑。@Cric帮帮忙,当我使用你的代码时,我得到了这样的ipaddress::1“.任何解决方案。php版本:5.6.2Did您指的是在internet连接中。谢谢。存储这些数据的方式是“会话”、“cookies”还是“mysql”?我认为
mysql
作为
session
cookie
会在某个时候被删除。是的。我在另一篇文章中读到了这样的内容。我认为最好保存在数据库中。混乱。@Cric帮个忙,当我使用你的代码时,我得到了这样的ipaddress::1。任何解决方案。php版本:5.6.2Did您指的是在internet连接中。谢谢。存储这些数据的方式是“会话”、“cookies”还是“mysql”?我认为
mysql
作为
session
cookie
会在某个时候被删除。是的。我在另一篇文章中读到了这样的内容。我认为最好保存在数据库中。混乱。@Cric帮个忙,当我使用你的代码时,我得到了这样的ipaddress::1。任何解决方案。php版本:5.6.2Did您指的是在internet连接中。谢谢。存储这些数据的方式是“会话”、“cookies”还是“mysql”?我认为
mysql
作为
session
cookie
会在某个时候被删除。是的。我在另一篇文章中读到了这样的内容。我认为最好保存在数据库中。混乱。@Cric帮个忙,当我使用你的代码时,我得到了这样的ipaddress::1。任何解决方案。php版本:5.6.2Did您指的是在internet连接中。