Posted by J.O. Aho on 09/29/38 11:32
Stefan Mueller wrote:
> But where do I have to store my already created random numbers so I can use
> them the next time the PHP page gets loaded.
There are many options, database, file, cookie...
You could ID each page with an ID number and store the ID number in your
session, if the ID number from the session is the same as the pages, then
don't generate a new number.
$pageid=22;
if (!isset($_SESSION["count_session"])) {
$_SESSION["count_session"] = 1;
}
else if($_SESSION["ID"] != $pageid) {
$_SESSION["count_session"]++;
}
$_SESSIOM["ID"] = $pageid;
> PS: I don't like to use cookies
Session is a cookie.
[Back to original message]
|