search

Home  >  Q&A  >  body text

What is the principle of obtaining the last login IP?

What is the principle of obtaining the last login IP?

海|Xian生海|Xian生1723 days ago1625

reply all(6)I'll reply

  • Storms

    Storms2020-05-16 15:22:53

    Database fields can be added, created, named,

    reply
    0
  • 海|Xian生

    However, the teacher did not add this field. What is obtained through the request object is the IP address of this login.

    海|Xian生 · 2020-05-16 15:32:50
  • 哈比

    哈比2020-05-15 14:40:31

    Re-create a login record table and save the information about each successful login to the database. When you log in next time, just go to the database to get the previous information of the current login record. To put it simply, for example, the database has 3 entries. Data, when I logged in, a new one was added to the database, four together, with IDs 1, 2, 3, and 4; the current login record ID is 4, so I searched for an ID record one level smaller than 4. That’s it

    reply
    0
  • 海|Xian生

    The data table does not save the IP field

    海|Xian生 · 2020-05-15 14:44:44
  • 对方正在输入....

    对方正在输入....2020-05-15 11:50:36

    Every time you log in, the current IP is stored in the database.

    reply
    0
  • 海|Xian生

    Can I use the request object to obtain database information?

    海|Xian生 · 2020-05-15 12:34:18
  • Cancelreply