[Resolvido] Variáveis flash e php
Bom dia,
Estou desenvolvendo um sistema de orçamentos onli mas me deparei com um problema envolvendo uma variável.
Após dois dias de pesquisa, continuo sem solução por isso venho recorrer aos amigos do fórum.
O sistema é o seguinte:
Tenho um formulário de login e senha em flash que está funcionando perfeitamente: manda as variáveis ao newlogin.php e executa a busca no mysql corretamente.
O AS é esse:
>
// Create 2 LoadVars objects to load and send data to the PHP script
var loader:LoadVars = new LoadVars();
var sender:LoadVars = new LoadVars();
status.text = "Informe o usuário e a senha";
// When the submit button is pressed...
sair.onRelease = function() {
_root.Flip.gotoAndPlay(11);
}
submit_btn.onRelease = function() {
// assign the text in the input fields to the sender object
sender.user = userinput.text;
sender.pass = passinput.text;
// _root.gotoAndPlay(1); só pata testar o botão
// 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("newlogin.php", loader, "POST");
}
visualiza.onRelease = function() {
// assign the text in the input fields to the sender object
sender.user = userinput.text;
// _root.gotoAndPlay(1); só pata testar o botão
// 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("listar_ordens_user.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.text = this.status;
_parent.gotoAndStop("Success");
gotoAndPlay(2);
}
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.text = this.status;
_parent.gotoAndStop("Invalid");
}
}
else {
// There was a problem retrieving the PHP file
status.text = "Falha na conexão com o servidor";
}
}
Após o login, abre uma tela onde aparece um botão para filtrar os orçamentos por usuário (o que logou anteriormente).
Mas o listar_ordens_user.php não recebe a variável do formulario flash. Tentei colocar o valor da variavel num label no form mas não dá nada, parece que a variável foi destruida ou está vazia.
Agradeço imensamente por opiniões e alguma ajuda pois preciso solucionar o problema urgente.
Muito obrigado e um abraço à todos.
Paulinho Cé
Discussão (3)
Carregando comentários...