Auto Generating a Number and Insert into Field

Tips submitted by PHPMaker users
Post Reply
mrcali
User
Posts: 8

Auto Generating a Number and Insert into Field

Post by mrcali »

Hello,

Here's a tip on how to auto generate a number and inserted it into a hidden field when you are making a new record, this is basic stuff but it is not readily apparent in the manual. Put this in the Row Inserting section of the Server Scripts, Client Scripts and Custom Templates Tab. Also make sure not to make the field editable if you never want to change the randomly generated number.

$randomnumber = rand();
$rsnew['fieldname']="$randomnumber";


Post Reply