A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Flash Sending Variables to PHP

  1. #1
    Senior Member
    Join Date
    Apr 2003
    Posts
    124

    Flash Sending Variables to PHP

    I am posting this for a friend. Ok, well I have a flash movie that is sending variables to a php script, and the php script will not receive the variables $user and $pass from the user.text and pass.text input feilds. If you need to test the username and pass you can use the following:
    Username:flashkit
    Pass:flashkit
    I have included the .fla.
    Thanks in advance for your help, it is greatly appreciated.

    The PHP script is:
    Code:
    <?php
    define('HOST', 'localhost');
    define('USER', '****');
    define('PASS', '****');
    define('DB', '****');
     
    mysql_connect(HOST, USER, PASS);
    mysql_select_db(DB);
    $result = mysql_query("SELECT COUNT(*) AS numfound FROM members WHERE username='".$user."' AND password='".$pass."'");
     
    $result_ar = mysql_fetch_array($result);
    if($result_ar['numfound'] < 1)
    {
    ?>
    success=0
    <?
    }
    else
    {
    ?>
    success=1
    <?
    }
    ?>
    Here is the .fla
    Last edited by rctroub; 12-28-2005 at 01:20 AM.

  2. #2
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I haven't opened your fla....have a feeling it's not needed.

    You are not picking up the POST's from the flash in your php but you reference them in the query:

    $user."' AND password='".$pass."


    Define them above in the php:

    $user = $_POST["user"]; //or whatever your post value for user is named
    $pass = $_POST["pass"]; //or whatever your post value for password is

  3. #3
    Senior Member
    Join Date
    Apr 2003
    Posts
    124
    When doing what you said, it still does not attach the variables. Any other help would wonderful. Thanks a bunch!

  4. #4
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Then it's your Flash syntax. I jumped off the Flash wagon at MX2004 and use something else for Flash 8 code. Someone else will have to offer to bugcheck your Flash FLA who has actual Flash 8.

  5. #5
    Senior Member
    Join Date
    Apr 2003
    Posts
    124
    Ok, well thanks for trying. As I said, I am posting this op for a friend, and would appreciate any help.

  6. #6
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    Did you copy swf to same directory where your php file is? They should be both in same place. Then call php without the full path:

    senderLoad.sendAndLoad("test.php",receiveLoad);

  7. #7
    Junior Member
    Join Date
    Mar 2004
    Location
    Sydney, Australia
    Posts
    14
    remember that flash will send using the get method if you are testing in auth program, it wont use post method till u run it separately...

    .. thought id say that 'cause ive fallen for that mistake before
    theres cheap, theres good and theres quick, but you can only have two at a time

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