简体   繁体   English

如何获得每个访问者的唯一 ID? php

[英]How can I get a unique Id of each visitor? php

In php在 php 中

I've created for each user a unique URL that if someone opens that URL points to be added to account user.我为每个用户创建了一个唯一的 URL,如果有人打开该 URL 指向添加到帐户用户。

My problem here is that anyone can do it only once.我的问题是任何人都只能做一次。

How can I get a unique Id of each visitor that does not duplicate?如何获得不重复的每个访问者的唯一 ID?

How can I get information hardware PC or Mobile visitor?如何获取信息硬件PC或Mobile访客?

您可以使用uniqid()函数来获得 uniq id 并将该值存储在 cookie 中。

You'll need another database that will store if the user has clicked on the link.如果用户单击了链接,您将需要另一个数据库来存储。 Once the link is clicked, You will need to check if the link has been clicked previously (the way you store this data is up to you).单击链接后,您需要检查之前是否单击过该链接(存储此数据的方式取决于您)。

If Yes: Alert the user.如果是:提醒用户。

If No: You will then need to write to a database signifying that the link has been pressed, and the next time the link is clicked, you should get an alert.如果否:您将需要写入数据库,表明该链接已被按下,下次单击该链接时,您应该会收到警报。

As for detecting if Mobile or PC, take a look at this library: http://mobiledetect.net/至于检测手机还是PC,看看这个库: http : //mobiledetect.net/

为每个访问者每次访问生成的服务器 PHP 会话也是唯一的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获取Google Analytics(分析)访问者的唯一ID? - How to obtain Google Analytics visitor unique id? 如何为数组中的每个对象添加唯一 ID? - How can I add a unique ID to each object in an array? 创建访客唯一ID? - create visitor unique ID? 我如何在php中存储访问者信息,例如到达时间,访问时间和访问者的确切位置 - How can i store visitor infomation like reach time ,duration of visit,and exact location of visitor in php 我如何获得数组React js中的第一个唯一ID元素和最后一个唯一ID元素 - how can I get the first unique ID element and last unique ID element in an array React js 我怎样才能为这个 js 中的每个类项目获得一个唯一的 id - How can i get a unique id for every class items in this js 如何在 javascript 中获得唯一的设备 ID? - how can I get a unique device ID in javascript? PHP获得唯一ID - PHP get unique id 我将输入类型的 id 作为唯一 id,那么我怎样才能将这些唯一 id 放入 javascript 中? - i am having id of input type as unique id so how can i get those unique id into the javascript? 如何使用javascript中的getElementById创建一个图像数组,每个图像数组都有一个唯一的id? - how can i create an image array, each with a unique id using getElementById in javascript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM