This content has been marked as final. Show 4 replies
>>if I publish to an HTML page the parameters do not appear in the browser
Right. That's because you're using POST - when you are in Flash, you use GET
regardless if you said "post" in the LoadVars.send(). That's why you see thu
params in the address bar - you don't see them when you use POST. PHP still
gets the values though...what exactly isn't working? Also, it's better to
use sendAndLoad - just send will replace the page you're viewing.
Adobe Community Expert
Thanks Dave for the helpful reply. I shoudl have been clearer - what isn't working is that the PHP script ISN'T picking up the values (but it does when I run the Flash outside of HTML). This seems to be unrelated (I now realise) to the issue of the parameters showing up in the browser address bar or not. Changing the "post" to "get" makes no difference.
Yes, I have been using $_REQUEST.
The test script looks like this:
$latin_name = $_REQUEST['latname'];
$common_name = $_REQUEST['commname'];
if ($latin_name == "")
$latin_name = "Not available";
$common_name = "Not available";
$connection = mysql_connect("localhost", "user", "pword") or die ("Unable to connect");
mysql_select_db("balloonflash") or die ("Database not found");
$query = "INSERT INTO species (latName, commName) VALUES ('$latin_name', '$common_name')";
$result = mysql_query($query) or die ("Unable to execute query: " . mysql_error());
It seems like the script is not triggered at all when I run the Flash form from HTML - I don't even get the default values entered into the database. Actually, yes I do, my mistake - but the variable values are not being passed over.
The HTML source generated looks like this:
WIDTH="291" HEIGHT="234" id="flashForm1" ALIGN="">
<PARAM NAME=movie VALUE="flashForm1.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#66FFFF> <EMBED src="flashForm1.swf" quality=high bgcolor=#66FFFF WIDTH="291" HEIGHT="234" NAME="flashForm1" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE=" http://www.macromedia.com/go/getflashplayer"></EMBED>