Hola gente del foro.
Estoy intentado hacer un login de usuarios en flash y q al hacer login me diriga a mi pagina .php
El tema es q pongo login y parece q no pasa nada es decir no se dirige adonde quiero. Pero luego, ingreso a la pagina a la que hay que ingresar con el login de otro modo y es como si me hubiera logeado.
Les dejo mi codigo as3.
Código:
stop();
// Create 2 LoadVars objects to load and send data to the PHP script
var loader:LoadVars = new LoadVars();
var sender:LoadVars = new LoadVars();
status = "Enter your information and submit";
// When the submit button is pressed...
submit_btn.onRelease = function() {
// assign the text in the input fields to the sender object
sender.usuario = usuario.text;
sender.password = password.text;
// and then send it on to the PHP file on the server using
// the POST method. The returned result will be caught
// by the loader object
sender.sendAndLoad("validar_usuario.php", loader, "POST");
}
// The loader object waits for a response from the server
// and checks for any returned variables, messages, errors.
loader.onLoad = function(success:Boolean)
{
// This boolean variable (success) will return true or false
// on whether the PHP file was retrieved
if(success)
{
// If we're here then we've successfully retrieved
// the PHP file. Lets check for a Login result
if(this.checklog == 1)
{
// This is a authorised login so show the success frame
// and show the message in the status textfield
status = this.status;
_parent.gotoAndStop("Success");
}
else if(this.checklog == 2)
{
// This is a unauthorised login so show the failure frame
// and show the error message in the status textfield
status = this.status;
_parent.gotoAndStop("Invalid");
}
}
else {
// There was a problem retrieving the PHP file
status = "Error connecting to server";
}
}
Le puedo agregar algo asi como href, header, action o nose algo para que me diriga al hacer login, a la pagina .php q yo deseo ?
Gracias atodos de nuevo