开发者

How to display a unique id with $_GET? [duplicate]

开发者 https://www.devze.com 2023-03-01 16:58 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How to generate unique id in mys开发者_运维知识库ql?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to generate unique id in mys开发者_运维知识库ql?

I have a uniqid() php script on my site which generates a unique id for every unique visitor. I would like to give each user a unique link which is displayed in a an input form, in the form of http://website.com/?id=12345 . Does anyone know how to do this?

I saw a different site accomplish this, so I know it's possible. I also know that I have to use the $_GET function since there is a ? after the url. Help.


<form action="http://website.com/" method="get">
 <input type="hidden" name="id" value="<?=uniqid()?>" />
 <input type="submit" value="Submit" />
</form>

This should do the trick...


Then on the page you submit to...

<?php
 echo $_GET['id'];
?>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号