PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hello, I am trying to create a dynamic playlist using php and mysql. I used the header Content-Type: video/x-ms-asf to ask the browser to open the content using windows media player, will this work all the time ? and also do you know what is the mime type or content-type for real one video ?
<?php
require_once('database.php');
if(isset($_GET['i'])){
$result = mysql_query('SELECT playerType, url FROM playlist WHERE id='.$_GET['i'],$db->connection) or die(mysql_error());
if(mysql_num_rows($result) > 0){
$r = mysql_fetch_assoc($result);
if($r['playerType'] == 'wmp'){
header("Content-Type: video/x-ms-asf");
echo "
<ASX Version='3'>
<title>video name</title>
<ENTRY>
<REF HREF=".$r['url']."/>
</ENTRY>
</ASX>";
}
else if($r['player'] == 'realOne'){
header("Content-Type: "); // I am not sure what is the mime type for real one player.
echo $r['url'];
}
}
}
?>