...

View Full Version : Random number in html/php link



alxne
02-22-2012, 06: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?

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

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum