I have been assigned work on a website that was converted to Drupal and has an embedded flash application written with Action Script 2.0. The application allows users to create a recipe from a group of ingredients in a dropdown box. The application then stores the recipe in a table in a MySQL database. After the user creates the recipe and clicks the “Save” button, I need to have the flash application check if the user is registered and logged in before the recipe is saved to the database. If the user is registered and logged in the application will save the recipe, however if they are not, the user will be prompted to resister and or log in. The catch is that the recipe they created before they were logged in has to still be there when they complete the registration process and/or log into the site.
My idea was to write a script in Flash that uses LoadVars to load a variable from a PHP script that checks the database for a Drupal identifier indicating that the current user is logged in. The Script would echo a string like “&true” if they are. Using an “if, else” statement the application would either continue unaffected if “true” or redirect the user to the login/signup page if not. If the user is redirected, how can the recipe that they created be stored temporarily in the database and moved to the correct table once the user has logged in?
I think that this can be completed using scripts like those used in a flash shopping cart application where a user can add items to their shopping cart, but cannot proceed to checkout without registering an account and once registered all the items are still located in that users cart.
The “Save” recipe button in the application I’m working on is like a shopping cart’s “check out” button in which when clicked, the application redirects unregistered users to a sign-up page while keeping their items in the shopping cart until they checkout.
I don’t know how to write most of the PHP code and am not sure if I’m exactly correct about the AS2 LoadVars class. If anyone any suggestions or tips I would appreciate the assistance as I will be up for the next 48hours straight or until I can figure it out. Thanks in advance for your help.
-Jon
Comments
is there an update on this?
is there an update on this?