How to generate a random but unique number and display that number within the source of my image tag

Posted by Matthew on Stack Overflow See other posts from Stack Overflow or by Matthew
Published on 2010-06-10T15:12:24Z Indexed on 2010/06/10 15:22 UTC
Read the original article Hit count: 270

Filed under:
|
|

Hello guys,

I have done some searching but really haven't found what I'm looking for. What I would like to do is generate a random BUT unique 5 digit number and push whatever number into an img tag on my page.

For example when people come to my page this number would generate and get pushed into this image tag:

<img src="http://www.sample.com?randomNUM=12345" height="1" width="1" />

I have a mySQL DB and am looking to do this in PHP.

Thank,

Matt

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql