[英]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.