You are here: Issue with generating asx playlist with php « PHP « IT news, forums, messages
Issue with generating asx playlist with php

Posted by Dan Rossi on 08/29/05 10:20

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 ?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация