View Full Version : Random number in html/php link

02-22-2012, 07:37 PM
I'd like to generate a random number from between 1 and 5000,

This is how a link normally looks on my website - http://mysite.net/index.php/details.php?mid=754

The code for this is <a href="http://mysite.net/index.php/details.php?mid='.$v['id'].'"> (the number is chosen depending on which link is selected.)

I'd like to create a link that whenever its clicked it throws a random number in place. Can anyone help?

02-22-2012, 07:49 PM
Use rand() (http://php.net/rand) wherever you're setting the id

02-22-2012, 07:52 PM
How would I use it in the link? someone has wrote the script for me I'm not an expert :/