flash - Secretly adding (extra) HTTP GET Variables to a swf file through PHP -
i'm trying build workaround embedding (downloaded) flash videoplayer. (it's jwplayer...)
at moment, when wants embed videoplayer have include swf added flashvars (ex: www.site.be/core/swf/player.swf?streamer=url&file=file.mp4&image=file.jpg&plugin=analytics...). that's messy, , feels bit risky... people know doing can remove plugin , other added data, resolving in me not being able track pageviews etc.
my workaround this:
$data = file_get_contents('url'); header("content-type: application/x-shockwave-flash"); echo $data;
turns out that, when use file_get_contents on regular test file, info.php, responds through $_get['var'], above stated code works, when use on flashplayer, doesn't...
as in: flash file not seem accepting (or responding to) added header variables...
can tell me why is? 'flash' related problem or 'php' related problem? or there suggestions on how handle "flash-embed-with-to-much-junk"-problem in different way?
(thanks)
the flash expecting parameters can't force them other way.
what store variables in session (called swf_vars in example) if want secret, have <embed>
code point php script like..
<?php session_start(); // full url path swf $url = "http://www.site.be/core/swf/player.swf?"; // these variables want foreach ($_session['swf_vars'] $key => $value) { $url .= $key . "=" . urlencode($value) . "&"; } $url = rtrim("&", $url); // fetch swf header("content-type: application/x-shockwave-flash"); echo file_get_contents($url); ?>
Comments
Post a Comment