Jump to content

amprodes

Members
  • Content count

    1
  • Joined

  • Last visited

Profile Information

  • Real Name
    Andree Malave
  1. amprodes

    Pass osCommerce session IDs into Flash

    Hi there !! hey am trying to make a flash app that login into oscommerce store using the id sessions the php works great but flash doesnt understands it... this is what am doing (i dont know flash scripts) php: <? require('includes/application_top.php'); if ($session_started == false) { tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE)); } if (isset($_GET['action']) && ($_GET['action'] == 'process')) { $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); $password = tep_db_prepare_input($HTTP_POST_VARS['password']); //connect to database if ($email_address && $password){ mysql_pconnect("internal-db.s21827.gridserver.com","db21827","lyeVaRR8") or die ("didn't connect to mysql"); mysql_select_db("db21827_data_fullcopas") or die ("no database"); //make query $query = "SELECT customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id FROM customers WHERE customers_email_address = '" . tep_db_input($email_address) . "' AND customers_id = '" . tep_db_input($password) . "'"; $result = mysql_query( $query ) or die ("didn't query"); //see if there's an EXACT match $num = mysql_num_rows( $result ); if ($num == 1){ if (SESSION_RECREATE == 'True') { tep_session_recreate(); } print "status= Sesion Recreada = True&checklog=1"; $check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$result['customers_id'] . "' and address_book_id = '" . (int)$result['customers_default_address_id'] . "'"); $check_country = tep_db_fetch_array($check_country_query); $customer_id = $result['customers_id']; $customer_default_address_id = $result['customers_default_address_id']; $customer_first_name = $result['customers_firstname']; $customer_country_id = $check_country['entry_country_id']; $customer_zone_id = $check_country['entry_zone_id']; tep_session_register('customer_id'); tep_session_register('osCsid'); tep_session_register('customer_default_address_id'); tep_session_register('customer_first_name'); tep_session_register('customer_country_id'); tep_session_register('customer_zone_id'); } else { print "status=Sorry, but your user name and password did not match a user name/password combination in our database. Usernames and passwords are entered in from a different file. Thank you for visiting test login script!!&checklog=2"; } } if (tep_session_is_registered('customer_id')) { print "&customer_id=" . $customer_first_name; print "&osCsid=" . str_replace("osCsid=", "", $SID); } else { print "&customer_id=Guest"; print "&osCsid=" . str_replace("osCsid=", "", $SID); } if (sizeof($navigation->snapshot) > 0) { $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); $navigation->clear_snapshot(); tep_redirect($origin_href); } tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . (int)$customer_id . "'"); } $result = tep_db_query("select customers_private_messages from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . " '"); $check_result = tep_db_fetch_array($result); print "&private_messages=". $check_result['customers_private_messages']; ?> and the flash scripts: on (release, keyPress "<Enter>") { if (email_address != "" && password != "") { status = "Begin Login Process - Wait..."; if ((osCsid != undefined) && (osCsid != '')) { // if the variable osCsid has been defined and it contains a value (not empty), we // will load the flash_variables.php file with the session id appended at the end // of the URL. status = "hay variable"; loadVariablesNum("newlogin.php?action=process&osCsid="+osCsid, 0, "POST"); } else { local_data = SharedObject.getLocal("user_data"); //osCsids = local_data.data.osCsid; local_data.data.osCsid=_root.osCsid.text; //customer_ids = local_data.data.customer_id; local_data.data.customer_id=_root.customer_id.text; local_data.flush(); status = " no hay variable"; // if the variable osCsid is undefined or it is defined but contains no value (it is // empty) than we will load the flash_variables.php file without the session id // so that osC will generate one for us and pass it back. loadVariablesNum("newlogin.php?action=process", 0, "POST"); } } } this send a id session empty and here am trying to tell the user if he or her have a private message then show it in the flash movie :'( can anybody help me please????
×