A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: FLASH => PHP => SQL, FLASH TO PHP TO SQL

  1. #1
    Junior Member
    Join Date
    Feb 2006
    Posts
    12

    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.

  2. #2
    Junior Member
    Join Date
    Oct 2005
    Posts
    26
    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...

  3. #3
    FK Newb Beater
    Join Date
    Dec 2002
    Location
    Seattle
    Posts
    676
    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.
    Just because you changed the code, doesn't mean it's yours

    Most Recent Work:
    Commercial tanning beds website

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center