Use of a global variable ('submission counter') I'm trying to construct a registration form (of a node) wich stores serial (ascending) values in a hidden field.
The form is open to unregistered users.
I made it with rules and variable (every time a node of type xxx is saved, the global variable is +=1 and stored in the correct field), but... If two nodes are submitted at the same time, this variable can be dupplicated.
Any ideas on how avoid this behaviour?
Thank you.
I would recommend implementing the Serial Module:


  This module provides an auto-increment (serial) field.
  
  Unlike Drupal's built-in auto-increment node ID, which is global and
  shared by nodes belonging to all content types, serial fields are
  managed per content type (D6) / entity (D7). For example, the serial
  field of an Invoice instance will generate a unique sequential number
  (starting at 1, then 2, etc.) exclusively for Invoice instances.
  
  The allocation of serial numbers by this module is atomic. In other
  words, the serial values are unique even when multiple instances of
  the same content type / entity are created simultaneously.