December 12th, 2012, 11:20 AM
PHP x Flash
I have a system developed in PHP and Flash. It is divided into layers (MVC). I'm facing the following issue: the form, which is done in Flash, sends data to PHP via POST. I threw an exception printing what is coming from the form. When I click "Save" the data come black. As what I filled out the form remains on the screen, if I click again on "Save" the data are sent normally.
What can it be? Anyone got a light?
Thanks in advance!
December 12th, 2012, 12:03 PM
Once the data goes black it'll never come back.
Maybe it's just me but I don't get that description. Got some code to show us?
Comments on this post
December 12th, 2012, 12:13 PM
mistyping: "blank". :-)
In the Flash form:
Servidor.sendAndLoad("Servidor.php?p1&p2&p3&ck=" + new Date().getTime(), Mensagem);
In the integration between Flash and PHP (php page):
$matricula = trim($_POST['Matricula']);
It's simple, but when I do this:
throw new Exception('Identificador: '. $_POST['Identificador'] . 'Mat: ' . $_POST['Matricula'] . 'Nome: ' . $_POST['Nome']);
$mensagem = 'Erro='.urlencode($ex->getMessage());
The POST fields come blank at the first time and filled out in the second time on... weird...
December 12th, 2012, 01:23 PM
Pull out a network monitoring tool like Firebug (not sure if that works on Flash) or Fiddler and examine the actual requests that are being sent to see what data is being included in the request. If I had to guess I would say this is not a problem with your PHP code, but something on the client side.
Comments on this post
December 14th, 2012, 11:02 AM
I used the Chrome Developer Tools and I saw that the data is being sent normally... I wonder if it's a problem in Apache server...
December 14th, 2012, 01:58 PM
Are you working with large quantities of data?
December 14th, 2012, 07:39 PM
No, it's a little amount of data.
It seems to be a source-code issue. I think I'm getting close to the solution...
January 8th, 2013, 10:18 AM
It was a code issue. Thanks!
However, now the application only works in Chrome. In IE it's random. Every other time, it works. Does anyone know what can be the cause of that intermittency of IE?