Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2012
    Posts
    22
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Random number in html/php link

    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?
    Last edited by alxne; 02-22-2012 at 07:52 PM.

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Use rand() wherever you're setting the id

  • #3
    New Coder
    Join Date
    Feb 2012
    Posts
    22
    Thanks
    1
    Thanked 0 Times in 0 Posts
    How would I use it in the link? someone has wrote the script for me I'm not an expert :/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •