Hi, Sergey -
I need to generate random number on my Parts table's add page. I put this code within the <?php & ?> codes on the parts_add page.
//produce random numbers
srand((double)microtime()*1000000);
//number between 300000000 and 399999999
$random_number1 = rand(300000000,399999999);
and then, under formatting, under 'edit as', I have added this expression under default value of this text field
<?php echo ("$random_number1"); ?>
Seems like that ought to work, doesn't it?
I cannot see all the examples of expressions on that default value page, so don't know for sure if my expression is correct. Apparently not.
I get this error message:
Parse error: parse error, unexpected T_ECHO in /home/webs/americantrans/CAT2/include/PARTS_functions.php on line 537
Is there an easier way to generate a random number on the add page, such as that for new parts?
Thanks.