Comunidad de diseño web y desarrollo en internet online

flash app que hace login en oscommerce y usa los id session!

Citar            
MensajeEscrito el 08 Feb 2008 12:54 am
:crap: saludos estoy tratando de hacer una aplicacion flash que hace login a oscommerce desde flash ... no adherido al explorer... el php hace todo bien pero el flash entra logea pero la session parece que no la reconoce o es vacia .. no entro como guest pero tampoco como usuario registrado.. estoy usando no el password porque oscommerce lo pasa por md5 y es mas complicado eso lo dejare para despues por ahora como pass uso el id del usuario solo por razones de development...alguien me puede ayudar?...

//////////////////////////////INICIO DEL CODIGO DEL 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');
print "status= Sesion Iniciada= True&checklog=1";
} 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'];


?>
///////////////////////////////////FIN DEL CODIGO PHP//////////////////////////////////////
///////////////////////////INICIO DEL CODIGO DEL ACTIONSCRIPTS/////////////////////////////
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("http://midominio.com/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("http://midominio.com/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????
///////////////////////////FIN DEL CODIGO DEL ACTIONSCRIPTS////////////////////////////////
:cry:

Por amprodes

1 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 10 Feb 2008 12:06 am
Todo el mundo lee pero nadie me ayuda :cry: quisiera que me ayudaran ^^

Por amprodes

1 de clabLevel



Genero:Masculino  

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.