A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: problem with using POST and variables (flash-php-windows)...

  1. #1
    yes...

    php & windows together doesn't sound good, but since we have to use Access-database via ODBC (does anyone know how to use Access/ODBC from Linux ?) in our project, we had to do it this way.


    we have php installed on win2000 server (SP2).

    on this project, php is communicating with : text-files, access(ODBC) etc. by using POST calls into php-scripts from Flash...

    example call:

    ---
    loadVariablesNum ("foo.php", 0, "POST");
    ---

    then there are different php-scripts which are used from the Flash (POST), which make different tasks (read/write text-files, read/up-date database etc.) and some use variables from Flash, while some don't need them (just reads text-files etc.).

    the problem is that sometimes (depends server enviroment) variable values doesn't transfer from Flash into php when using code above.

    on my win2000 server code works fine, same with our Linux server, but...


    on win98/Apache/PHP enviroment POST doesn't transfer values (this actually isn't biggest problem...)

    it doesn't work on other win2000 server (which is our office and will be the public server) where is installed same php-version etc. etc.

    only difference on these win2000 servers is that other has SP2 (the one where "POST/value transfer" doesn't work) while other doesn't have any SP's installed (my development server, where "POST/value transfer" works).

    so... interesting problem, 2 similar win2000 Servers and "POST/value transfer" works on other while it doesn't work on the other one.



    anyone have had similar problem and solution for it ?

    help would be truely appreciated.


    if there's any solution for this, I've to :

    1) change php-scripts to Linux server and then there will be problem with Access/ODBC, unless someone know how to use it from Linux (Access database has to be on windows server, because it is simultaneously used by other application from different interface...).

    2) change all php-scripts into asp-scripts... which would take time and I don't know if there is 100% quarrantee how flash-asp-flash works.

    but... if only alternative is 2... anyone used Flash with ASP ?

    all basic "tips" appreciated and some possible links where to get basic info... and info if there are any pitfalls on using Flash & ASP together (example problems I descriped above...)


    but... like I said, all help is appreciated to solve my "little" problem!




    [Edited by Jukkis on 05-07-2002 at 03:02 PM]

  2. #2
    anyone had similar problem ?

    or experiences from similar enviroment (flash/php/win2000 server/IIS 5.0) ?

    the problem obviously is with POST request and I've assumed that the problem is with php... but could it be some "odd" bug on Flash ?


  3. #3
    Stick In The Mud
    Join Date
    Oct 2000
    Posts
    752
    Hi there,
    i vaguely remember reading somewhere that flash actually sends a POST request as a GET request with the parameters in the body of the request!!!

    if i can find the link to the article i'll post it here..

    hope this helps,

    andy

    p.s. couldn't find it but hopefully one of the following links might help....
    http://actionscript-toolbox.com/samplephpmysql.php
    http://www.asp101.com/articles/flash/index.asp
    http://www.smartwebby.com/Flash_and_ASP/default.asp
    [Edited by SubKloda on 05-07-2002 at 06:35 PM]

  4. #4
    Hi there, i vaguely remember reading somewhere that flash actually sends a POST request as a GET request with the parameters in the body of the request!!!
    aha... but how "the body of the request" is defined on Flash ?

    is it frame (all cells on frame where request is triggered), single cell or whole scene ?

    so far I have understood that POST request sends all defined parametres (or variables) to php (??!! which sounds bit absurd)... but on the other hand I haven't had time for studying this area really good (probably making some tests today).

    Is there some way to define what parametres are send with POST request ?



    I'm checking today links you posted about flash/asp, thanks !!!

    it will be the last change for getting our project, unless we find way to get POST request working on our public win2000 server.


  5. #5
    Senior Member
    Join Date
    Feb 2001
    Posts
    1,835
    hi,

    can't help you with the server side but Flash sends all variables from the same timeline as the loadVariables call was called for.

    (for, not from. so _root.myMC.loadVariables(...) sends variables defined in _root.myMC timeline, doesn't matter where the call originates from)

    sounds a little strange that the server should have anything to do with request being sent - surely this is a client side action??

    - n.

  6. #6
    ok. thanks from the info about using POST with Flash.


    actually I just solved the problem...


    it was on php.ini file:
    ---
    variables_order = "EGPCS"
    register_globals = on
    ---

    first one was missing totally and later was "off" as default (on new php win binaries, downloaded from http://www.php.net ).

    this info was at php.ini file...

    ---
    ; Whether or not to register the EGPCS variables as global variables. You may
    ; want to turn this off if you don't want to clutter your scripts' global scope
    ; with user data. This makes most sense when coupled with track_vars - in which
    ; case you can access all of the GPC variables through the $HTTP_*_VARS[],
    ; variables.
    ;
    ; You should do your best to write your scripts so that they do not require
    ; register_globals to be on; Using form variables as globals can easily lead
    ; to possible security problems, if the code is not very well thought of.
    ----

    so... global scope for http variables was turned off due security reasons and on php it's possible to use $HTTP_*VARS[] for accessing example Flash variables, if you want to do it "right" way.

    myself I've hurry, so I'm using the "easy" way... maybe change it later when I've time for studying how to use $HTTP_*VARS[] ...


    I hope this info helps some other who are having same problem with using flash/php on windows enviroment.


  7. #7
    Senior Member
    Join Date
    Feb 2001
    Posts
    1,835
    Originally posted by Jukkis
    Using form variables as globals can easily lead
    ; to possible security problems, if the code is not very well thought of.

    excellent - tell us the URL, we'll try to hack it

    - n.

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