A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: flash PHP ... using LoadVars.sendAndLoad

  1. #1
    Member
    Join Date
    Nov 2000
    Posts
    62
    Hey peeps,I am in the process of writing a simple script that uses the new LoadVars obj, in MX. I figured this would be fairly easy and so far I have found myself beating my head against the monitor on this.....

    First I have 2 txt fields. (uField, pField)
    then I have this:

    connect=new LoadVars()
    connect.onLoad=function(){ _root.displayField=pResult //pResult is the var kicked back from the php script
    }
    connect.fUser=_root.uField.text
    connect.fPass=_root.uPass.text
    connect.sendAndLoad("/scripts/login.php",connect)
    <code end>--------------------------------------------------------------
    Now, to the best of my knowledge, the flash vars (fUser, and fPass) never get into the php script. What am I doing wrong?.. at the beginging of the PHP script I have an "if" statement to check if the fUser vcar is there.... and it isn't!like this:

    if(!$fUser){$pError="no flash var in";
    echo $pError;
    exit;
    };

    anyone have any ideas? Any help would be awsome. Thanks!!!!!Sum

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    running ltest and greatest php (>= 4.1)?
    Check if one of $HTTP_POST_VARS['fUser'] (any version php) or $_POST['fUser'] (new php) is there...

    Musicman

  3. #3
    Member
    Join Date
    Nov 2000
    Posts
    62

    I am beginner in PHP so ...

    Hey Musicman... I am a newbie when it comes to PHP, could you spell it out for me.... I dont get what you posted before or why...

    Thanks!

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    just replace the
    if(!$fUser)
    with
    if(!isset($_POST['fUser']))

    If you seem to get the ariable this way, add
    $fUser = $_POST['fUser'];
    lines for all the vars you want to get from your movie.

    I do not have MX experience so far, but shouldn't you add a POST bit to the code, same as for traditional loadVariables() function?

    Musicman

  5. #5
    Member
    Join Date
    Nov 2000
    Posts
    62

    Awwsome

    Hey!
    Hey thanks musicman!

  6. #6
    Senior Member hanszorg2's Avatar
    Join Date
    Sep 2004
    Posts
    308
    Sum can u post the PHP code too for this

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