-
FLASH => PHP => SQL, FLASH TO PHP TO SQL
Ok seriously this is hell. I've been searching these forums for information as well as google but recieving deadends all over the place. goToAndLearn doesn help as they dont use POSTvars, and other tutorials either use old methods that dont work in new php or the HTTP_POST_VARS which is too old. All I want to do is send a string 'name' to php for store in an SQL database for later recollection. Seriously this is getting old fast, I have used getURL, x.send, sendAndLoad, loadVars, etc, and I cant figure it out, no data is passed. NONE.
-
Could the error be in the PHP code? Is it possible that the string is passed, but not stored properly in SQL? Hard to be more specific without a code example...
-
This is the general format for loadVars:
Code:
function sendStr(data1:String, data2:String, data3:String, dataN...:String):Void {
var postToPHP:LoadVars = new LoadVars();
var Success:LoadVars = new LoadVars();
postToPHP.var_param1= data1;
postToPHP.var_param2= data2;
postToPHP.var_param3= data3;
postToPHP.sendAndLoad("http://www.myWebsite.com/myPHP.php", Success, "POST");
Success.onData = function(str:String) {
// Server Respose is in the 'str' param
}
Then just invoke the function like this:
Code:
var loadEm = sendStr("thank", "you", "very much");
you can check if any vars were posted to PHP using this code on PHP
PHP Code:
foreach ($_POST as $key => $value) {
print($key."=".$value."/n");
}
Last edited by Sleeve; 03-31-2006 at 09:50 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|