A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: passthru doesn't work with '?' after filename

  1. #1
    Senior Member Vincent26381's Avatar
    Join Date
    Feb 2003
    Location
    The Netherlands
    Posts
    833

    passthru doesn't work with '?' after filename

    Hi,

    I'm having major problems with this. Spend a whole day and night on it and can't figure it out for even a small bit:


    PHP Code:
    <?
    header("Content-type: application/swf");
    session_start(); 


    if ($var_waarde == "Gewoon een waarde"){
    if ($HTTP_POST_VARS["login_user"]){

    $filename = 'index2.swf'; 

    passthru( "cat " . $filename );
    }
    }
    ?>
    That works, and this doesnt:


    PHP Code:
    <?
    header("Content-type: application/swf");
    session_start(); 


    if ($var_waarde == "Gewoon een waarde"){
    if ($HTTP_POST_VARS["login_user"]){

    $filename = 'index2.swf?login_user=' . $login_user; 

    passthru( "cat " . $filename );
    }
    }
    ?>
    When I use the last script I simply get a 'movie not loaded'. At least it should load the movie, maybe not passing the var, but no movie at all?!
    I have no idea why this shouldn't work; all I want to do is pass the var to flash.

    Thank you,

    Vincent
    Vincent
    SWIS BV

    Last edited by Markp.com on 07-23-2003 at 02:25 AM

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

    sorry, no....
    What you are doing there is
    cat file.swf?sumestuff
    Now, this is the OS rather than the webserver that will handle this, and it treats the entire string as a file name

    The way file.swf?xx really works: the browser sends this string to the server AND remembers it locally.
    Now the flash player can use the local version of the string to set initial variables for the movie (or, if you use file.html?xxx, javascript could do that)
    At the same time the webserver will get the request, locate the file portion, and possible handle the parameters. Of course, there is nothing to handle for plain swf or html, but perhaps for php

    In plain words: for the flash player to see a variable, you would either have to redirect, so that the browser can see the parameter first, or replace the simple cat by a script that adds your variable right to the movie
    Check the swfaddvars entry at www.fontimages.org.uk

    Musicman

  3. #3
    Senior Member Vincent26381's Avatar
    Join Date
    Feb 2003
    Location
    The Netherlands
    Posts
    833
    Cheers Musicman

    It works now, thought of a different way after you mentioned the OS handles it. Thanks.

    demo (username: demo, password: password) Think it's pretty safe (at least safe enough i think)

    Vincent
    SWIS BV

    Last edited by Markp.com on 07-23-2003 at 02:25 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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center