1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Parse swf with PHP header

Discussion in 'PHP' started by dargre, Jul 10, 2008.

  1. #1
    As I know it is easy to parse simple swf file in php with flash header:
    
    <?php
    $filename="xxx.swf";
    header("Content-Type: application/x-shockwave-flash");
    @readfile($filename);
    ?>
    
    Code (markup):
    or

    
    <?php
    $filename = "xxx.swf";
    $fh = fopen($filename,"r");
    header("Content-type: application/x-shockwave-flash");
    fpassthru($fh);
    ?>
    
    Code (markup):
    But I'm not able to force any swf file to work with some flashvars, eg.
    $filename = "xxx.swf?config=yyy.xml";

    Any idea for that? or workaround?

    - D.
     
    dargre, Jul 10, 2008 IP
  2. dargre

    dargre Peon

    Messages:
    1,007
    Likes Received:
    161
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Bumping up. Nobody knows?

    youtube use it, metacafe, dailymotion, etc.
    Eg.
    Within youtube embed code you have movie url:
    http://www.youtube.com/v/037uSAIahho
    Of course this is not flash file.
    It is redirected and outputs correct swf file with lot of flashvars.

    How to do such thing?
    Will pay for solution or showing right direction how to...
     
    dargre, Jul 10, 2008 IP
  3. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #3
    try using htaccess!!!
     
    EricBruggema, Jul 12, 2008 IP
  4. dargre

    dargre Peon

    Messages:
    1,007
    Likes Received:
    161
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes I tried, but seems I have too many, nested flashvars, like:

    movie.swf?conf=fonfig.php?value=xxx&settings=set.php?value=xxx


    As far I found I can parse movie as javascript (also with rewrite method).
    The code is very short and generates swf object nested in DIV.
    The only minus is that the end user cannot change movie dimensions (or maybe it is plus).
    An example of embed movie:
    http://www.ejamtube.com/embed.php
    and original:
    http://www.guitar-tube.com/watch/santana-feat-alicia-keys.html

    Still I'm looking for better solution, though what I found now is not so bad :)
     
    dargre, Jul 12, 2008 IP