gleison_gomes Posted December 12, 2012 Share Posted December 12, 2012 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! Quote Link to comment Share on other sites More sharing options...
Christian F. Posted December 12, 2012 Share Posted December 12, 2012 First and foremost you should be capturing/dumping the POST data somewhere, so that you can verify that it is indeed correct on the first submission (and identical to the second). If that doesn't help, please post your code: Without it we have no idea what's actually happening, and thus have no idea on what the actual problem is. Quote Link to comment Share on other sites More sharing options...
gleison_gomes Posted December 13, 2012 Author Share Posted December 13, 2012 Sorry, mistyping: "...data come black...". :-) 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... Quote Link to comment Share on other sites More sharing options...
gleison_gomes Posted December 14, 2012 Author Share Posted December 14, 2012 I used the Chrome Developer Tools and I see that the data is being sent normally... I wonder if it's a problem in Apache server... Quote Link to comment Share on other sites More sharing options...
Christian F. Posted December 14, 2012 Share Posted December 14, 2012 You'll need to debug this issue on the server side as well. Chances are extremely high that the problem is in your code, as a lot of people would be experiencing the same issues if the problem was with Apache. As stated above: Dump the POST request, request URI and anything else that might be of interest, into a file. Then go through the process with a fine-toothed comb, and you should be able to spot where the problem occurs. Quote Link to comment Share on other sites More sharing options...
gleison_gomes Posted December 14, 2012 Author Share Posted December 14, 2012 It's getting weirder... It started to work on Chrome but on IE it doesn't work... Maybe it's a bug in Internet Explorer... Quote Link to comment Share on other sites More sharing options...
gleison_gomes Posted January 8, 2013 Author Share Posted January 8, 2013 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! Quote Link to comment Share on other sites More sharing options...
haku Posted January 9, 2013 Share Posted January 9, 2013 (edited) Does anyone know what can be the cause of that intermittency of IE? Generally it's a problem in your code. Edited January 9, 2013 by haku Quote Link to comment Share on other sites More sharing options...
gleison_gomes Posted January 9, 2013 Author Share Posted January 9, 2013 But it's working on Chrome... Is there any known approach to be avoided in the code? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 9, 2013 Share Posted January 9, 2013 (edited) The server-side code that you did post, isn't even checking if a form has been submitted. It's likely the browser is (re)requesting the page for some other purpose that isn't a POST request or perhaps is submitting a post request itself, in addition to the flash, that doesn't contain any data. What's the HTML of your page containing this flash form? It's likely invalid and one browser type is handling it differently than the other. Edited January 9, 2013 by PFMaBiSmAd Quote Link to comment Share on other sites More sharing options...
gleison_gomes Posted January 9, 2013 Author Share Posted January 9, 2013 Thanks for the reply. Actually, there's no HTML form. The forms are built by the Flash object... Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 10, 2013 Share Posted January 10, 2013 (edited) No one asked for a HTML FORM. They asked for - What's the HTML of your page containing this flash form? It's likely invalid and one browser type is handling it differently than the other. Until you post code that reproduces the problem, no one here will be able to help you find what is wrong with what you are doing. Edited January 10, 2013 by PFMaBiSmAd Quote Link to comment Share on other sites More sharing options...
gleison_gomes Posted January 10, 2013 Author Share Posted January 10, 2013 I'm sorry. I misunderstand the question. The HTML code is: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="imagens/grid.css" rel="stylesheet" type="text/css"> <title>XXX</title> </head> <body bgcolor="#cccccc"> <!--url's used in the movie--> <!--text used in the movie--> <!-- saved from url=(0013)about:internet --> <div class="grid_azul"><span class="menusup-li">yyy</span><img src="imagens/marca-XXX.png" alt="XXX" width="183" height="25" class="img-marca"></div> <div class="grid_branco"></div> <div class="grid_verde"></div> <div class="grid_amarela"></div> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.ma...ersion=7,0,0,0" width="780" height="890" id="suprimento" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="suprimento.swf" /> <param name="menu" value="false" /> <param name="quality" value="high" /> <param name="bgcolor" value="#cccccc" /> <embed src="suprimento.swf" menu="false" quality="high" bgcolor="#cccccc" width="780" height="890" name="suprimento" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://get.adobe.com...r/flashplayer/" /> </object> </body> </html> Quote Link to comment Share on other sites More sharing options...
Christian F. Posted January 10, 2013 Share Posted January 10, 2013 Right away I can tell you that your doctype is missing, which will cause browsers to interpret it quite differently. Also, running your code through w3c's HTML validator provided this result: Result: 14 Errors, 2 warning(s) Quote Link to comment Share on other sites More sharing options...
gleison_gomes Posted January 10, 2013 Author Share Posted January 10, 2013 Thanks for the reply! I've changed the code and it's valid now. However, I'm still facing the error. The code now is: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR...ml4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="imagens/grid.css" rel="stylesheet" type="text/css"> <title>xxx</title> </head> <body bgcolor="#cccccc"> <!--url's used in the movie--> <!--text used in the movie--> <!-- saved from url=(0013)about:internet --> <div class="grid_azul"><span class="menusup-li">Suprimento</span><img src="imagens/marca.png" alt="eee" width="183" height="25" class="img-marca"></div> <div class="grid_branco"></div> <div class="grid_verde"></div> <div class="grid_amarela"></div> <object type="application/x-shockwave-flash" data="suprimento.swf?path=suprimento.swf" width="780" height="890"> <param name="movie" value="suprimento.swf"> </object> </body> </html> Quote Link to comment Share on other sites More sharing options...
Christian F. Posted January 10, 2013 Share Posted January 10, 2013 (edited) Is there any difference in the POST requests between when IE works and when it doesn't? If so, then you need to look into your (Flash, most likely) code to figure out why. Edited January 10, 2013 by Christian F. Quote Link to comment Share on other sites More sharing options...
gleison_gomes Posted January 10, 2013 Author Share Posted January 10, 2013 I don't know if there's a difference... Quote Link to comment Share on other sites More sharing options...
Christian F. Posted January 10, 2013 Share Posted January 10, 2013 Then you need to find out. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.