For the life of me, I've tried everything:
I've researched LoadVars on Adobe forum, used David Powers' books, googled
'flash to php', LoadVars, etc. and tried sendAndLoad, send, and using $_POST,
$_GET, $_REQUEST. $HTTP_POSTVARS but I keep getting this same error. any advice
please?
My goal with this simple app is to prototype being able to pass a variable
from flash to a variable in php.
Parse error: syntax error, unexpected T_VARIABLE in flash_to_SQL.php on line 5
Actionscript 2.0 code:
var c :LoadVars = new LoadVars();
c.testing = "123FOUR";
c.send ("http://127.0.0.1/flash_to_SQL.php","_self","POST");
php code: (I also tried $_POST, $_GET, $_REQUEST. $HTTP_POSTVARS)
<?php
//mysql 4.1.2, php 4 , NO mysqli
ecbo $_REQUEST ['testing'];
/?>
acframe - 25 Mar 2008 14:07 GMT
ecbo? shouldn't that be echo? :)
Jefferator - 01 Apr 2008 03:32 GMT
Not sure it is making it to ecbo...
durand - 04 Apr 2008 14:51 GMT
var formData:LoadVars = new LoadVars();
formData.fname = "Name";
formData.send("http://www.website.com/flash_php.php", formData, "POST");
<?php
$name = $_POST['fname'];
echo $name;
?>