Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / December 2006



Tip: Looking for answers? Try searching our database.

Problems with LoadVars.send and Firefox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
0500053 - 29 Dec 2006 15:06 GMT
There seems to be a problem with Firefox 2.x sending variables to PHP scripts
with the LoadVars.send/POST method. <br>
The same problem doesn't occur in IE or Opera.
<br>See this url for example to try in both FF and IE/Opera:
http://0500053.info/bugs/.
<br>The source files are http://0500053.info/bugs/loadVars.zip
Any ideas?
g.zelenka@iinet.net.au
cinemaguy - 29 Dec 2006 20:12 GMT
Put this code on your Submit button and delete Layer 2

on (release) {
    var srLv:LoadVars = new LoadVars();
    srLv.onLoad = function() {
        aresult.text = parseInt(lVars.val1) + parseInt(lVars.val2);
    };
    srLv.val1 = val1.text;
    srLv.val2 = val2.text;
    srLv.sendAndLoad("loadTest.php", "_blank", "POST");
}
0500053 - 30 Dec 2006 11:09 GMT
The problem isn't with the 3rd text box receiving the value of the loadVars
-That's just to confirm what the value(val1+val2)  should be. The problem is
that the values of the first two boxes aren't being posted to the PHP script
and the server logs show 'Undefined index" for those fields. The blank page
that pops up just hangs and doesn't echo the return values. I've tried
receiving the values back into a result_lv(send and load) and extracting the
values into a text field but the values of the send portion of the command are
never leaving the swf and reaching the server.
cinemaguy - 30 Dec 2006 16:44 GMT
Well it looks like it is working fine to me. I made some minor alterations to
your fla and php script which you can see in the code below but the php script
is grabbing the variables from Flash adding them together and then returning
the result back to Flash so that confirms to me that everything is working
correctly.
//
//

Actionscript on Submit btn
on (release) {
    var srLv:LoadVars = new LoadVars();
    srLv.onLoad = function() {
        aresult.text = srLv.fResult;
    };
    srLv.val1 = val1.text;
    srLv.val2 = val2.text;
    srLv.sendAndLoad("loadTest.php", srLv, "POST");
}

PHP Script
<?
$val1=$_POST["val1"];
$val2=$_POST["val2"];
$result=$val1+$val2;
echo "fResult=$result";
?>
0500053 - 30 Dec 2006 20:22 GMT
Thanks I don't know what's been going on but now everything is working fine
again. The only time it hasn't worked now is when I'm running it from localhost
through my wamp server. It must be the same problem that causes hassles with
mailto links in getUrl scripts from working properly within the local
filesystem. Happy new year.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.