|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
random numbers
should be very simple, but I didnt figure it out yet. My problem is, that I want to link to a (sub)page of a site which uses session ids (like 123456). so I think the only possibility to do the trick is to "simulate" the session id. I just want to fill in the link a random, 6 digits long number (it would be best if I could tell the script the randow number should be between 600000 and 999999).
so how do I do that? thx in advance |
|
#2
|
|||
|
|||
|
RE: random numbers
<?php
mt_srand((double)microtime()*1000000); $randnum=mt_rand(600000, 999999); ?> Bingo, you now have a variable called $randnum which contains a random number between 600000 and 999999. Niall |
|
#3
|
|||
|
|||
|
RE: random numbers
|
|
#4
|
|||
|
|||
|
RE: random numbers
thx
but now I have another problem: Of course those people who have cookies aktivated, get a cookie instead of a session ID. how do simulate that? here are four examples of how the values of the cookies were. do you think they are random or do they have something to do with the current date? and if not, how do I construct a random string with random chars? and if you have too much time left, how do I write a cookie with these values? Code:
GJBMMPLACPACKPHEADFJPMLA PJBMMPLAAFBCCMGGGFDFLFJG NKBMMPLADHADMIMHGHOLGEGG HLBMMPLAMKHJAGLIBKMCHDEF thx in advance |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > random numbers |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|