PDA

View Full Version : cannot figure out what's gone wrong



jass
11-29-2006, 01:56 PM
Can anyone help me out? I'm trying to embed videos using php. I cannot figure out where gone wrong. Thanks a lot.

<HTML>
<HEAD>
</HEAD>
<body bgcolor="#000000" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<center><br>
<EMBED SRC=movie.php?file=$name WIDTH=320 HEIGHT=256 AUTOPLAY=true CONTROLLER=true LOOP=false PLUGINSPAGE="http://www.microsoft.com/Windows/MediaPlayer/"></BODY>
</HTML>


movie.php:
<?
Header("Content-type: video/x-ms-wmv");
$open = '29112006.wmv';
?>

thetestingsite
11-30-2006, 02:43 AM
Is that the entire code or just a snippet? If it is the enitre code, in the PHP you do not have the variable file name in the PHP script posted above. Unless you have register_globals set to on in the php.ini file on your server, this will not work. If this is the case, you will need to add something like the following:



<?php
$file = $_REQUEST["file"];

if ($file == "something") {
$open = '29112006.wmv';
}

else {
$open = '';
}

Header("Content-type: video/x-ms-wmv");

echo $open;
?>


if that makes sense.

jass
11-30-2006, 04:18 AM
Thanks a lot. I have changed the php codes to the one you gave above but it is still not working.

In the if ($file == "something") {, do i need to substitute "something" ?

thetestingsite
12-01-2006, 02:25 AM
yes...that line just states that if the variable file (test.php?file=theFile) is equal to the word (phrase) "something" then continue with whats in the brackets. If not (else), continue with the next if-elseif statement. So in the php, change the "something" to whatever name you want in there to be accessed.

jass
12-01-2006, 04:09 PM
Thank you very much but still not working as it should be.

The 3 files are uploaded here : http://utopia.goldeye.info/

<EMBED SRC="movie.php?file=name" WIDTH=320 HEIGHT=256 AUTOPLAY=true CONTROLLER=true LOOP=false PLUGINSPAGE="http://www.microsoft.com/Windows/MediaPlayer/"><BR><BR>

movie.php:
<?php
$file = $_REQUEST["file"];

if ($file == "name") {
$open = '29112006.wmv';
}

else {
$open = '';
}

Header("Content-type: video/x-ms-wmv");

echo $open;
?>