Curious what the best way to pass a Drupal username/ID to an external database would be, when a user submits info from a form on the site. PHP/Javascript assigning it to hidden form field would be fine, but specifics on how to get Drupal to divulge it would be appreciated.

- C9

Comments

CloudNine’s picture

<?php
  global $user;
  $userid = $user->uid;
?>

...

<input type="hidden" id="owner_ID" name="ownerID" value="NONE" />

...

<script language="javascript" type="text/javascript">
  var userid = "<?php echo $userid; ?>";
  document.new_aircraft.ownerID.value=userid;
</script>