Thread: PHP x Flash

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0

    PHP x Flash


    Hi, guys!
    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!
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,122
    Rep Power
    9398
    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

    • aeternus agrees : I read somewhere "once you go black you never go back" seems this is debunked ;)
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0
    Sorry,
    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:
    try
    {
    throw new Exception('Identificador: '. $_POST['Identificador'] . 'Mat: ' . $_POST['Matricula'] . 'Nome: ' . $_POST['Nome']);
    }
    catch(Exception $ex)
    {
    $mensagem = 'Erro='.urlencode($ex->getMessage());
    echo die($mensagem);
    }

    The POST fields come blank at the first time and filled out in the second time on... weird...
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    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

    • msteudel agrees : Yes Firebug and Chome Developer network tabs work with flash
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0
    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...
  10. #6
  11. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Are you working with large quantities of data?
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0
    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...
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    5
    Rep Power
    0
    Hi, guys!
    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?

    Thanks!

IMN logo majestic logo threadwatch logo seochat tools logo