On 29/08/2005, at 10:00 PM, Dan Rossi wrote:
I have just discovered on closer debugging, the windows media plugin
is loading the file twice, i can see the stop button flicker twice and
i made an error log and the word loaded shows up twice, would this be
causing an issue with the session ?
Ok its quite obvious I just discovered the session is being created
again when the file is loaded from the windows media plugin therefore
token variable is not there. Any ideas what could have been doing this
? I logged two different sess id's being created.
On 29/08/2005, at 5:20 PM, Dan Rossi wrote:
Hi there I am trying to use php to output an asx playlist but depends
on a special hash in the url to prevent hotlinking. I am using a
session to store a generated token when generating the url to display
in an embedded player. The token is added in the filename and I am
using rewrite rules to load another php script which does a check of
the hash in the querystring with the token stored in the session.
However its having unexpected results. When i add the check for the
session token the media player either doesnt player in PC or outputs
playlist format not recognised in Mac. If i do a check for the hash
only its ok. Here is an example
if ($_GET['h'] && $_GET['filename'] && $this->hash) {
$file =
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);
$this->filename = preg_replace('/stream/','wmv',$file);
$this->tpl->compile('playlist.html');
header("Content-Type: video/x-ms-wmv");
die(trim($this->tpl->outputObject($this)));
}
breaks with this
if ($_GET['h'] && $_GET['filename'] && $this->token) {
$file =
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);
$this->filename = preg_replace('/stream/','wmv',$file);
$this->tpl->compile('playlist.html');
header("Content-Type: video/x-ms-wmv");
die(trim($this->tpl->outputObject($this)));
}
ideally i want it to look like
if ($_GET['h'] && $_GET['filename'] &&
(strcmp($this->token,$this->hash)==0)) {
$file =
WMSERVER.Feeds_Hotlink_Check::strip_paths($_GET['filename']);
$this->filename = preg_replace('/stream/','wmv',$file);
$this->tpl->compile('playlist.html');
header("Content-Type: video/x-ms-wmv");
die(trim($this->tpl->outputObject($this)));
}
they are being set earlier in the script like so
$this->token = trim($_SESSION['token']);
$this->hash = trim($_GET['h']);
any ideas ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php