Hi, for a research project I need to use a flash app that draws on some custom php for routines such as user authentication, writing results to a file, and so forth. My php/drupal coding knowledge is both thing and rusty.

The setup
My goal is to use one of the lightbox modules in drupal to pop the flash app over the drupal interface, this is mainly so that users can have maximum screen real estate. As the flash app is running it calls xml files and a php file for configuration and for some simple routines as I identify above.

My goal
Ideally I would like to have users authenticate on their way into drupal and pass their username to the flash app via it's php routines. The other option is to have users re-enter their user codes at each of three stages. (The app provides for storing user IDs in a php array statement in the php file and then check entered IDs against that.

The questions
First, after digging through forum backposts and the internet I have found a simple set of php statements for grabbing the user name from a global variable. Will my php execute in the same global environment as drupal? if so I can simple use this statement set to grab the user ID and set it in my own PHP

Second, it would appear that another option would be to have my php hit the drupal database, pull the user ID from the session table and derive the username from the user ID. This, as I understand it, would require embedding the datebase name, user and password in my php, much like the drupal setup file.

Third question, If it sounds above like I know barely enough to be dangerous and not enough to really pull any of this off, please let me know. As I said above, worst case scenario is having users authentic on the way into drupal, and then re-enter their user ID three more times. (Although users hate to do this sort of thing and it is error prone)

Also, I will continue to burrow around and see if I can solve this thing on my own, but if some kind soul would care to point me in the right direction for resources or would care to drop some code examples I would most appreciative.

Learning php, sql and drupal to a great extent is on my learning plan, but it unfortunately has to wait until I'm finished this research study.

Thanks
Troy