Hi,
I am generating a code based on this method:
$code = rand(1000000000, 10000000000);
$yr = date(Y);
$mnth = date(n);
$day = date(j);
$code = $yr . $mnth . $day . $code;
The code is generated correctly, but then I am getting these strange Error messages from the lines that produce the date values:
Notice: Use of undefined constant Y - assumed ‘Y’ in /var/www/html/anoox.com/test/random_gen_code.php on line 18
Notice: Use of undefined constant n - assumed ‘n’ in /var/www/html/anoox.com/test/random_gen_code.php on line 19
Notice: Use of undefined constant j - assumed ‘j’ in /var/www/html/anoox.com/test/random_gen_code.php on line 20
Why?
And How do I get rid of these erroneous error messages?