Results 1 to 5 of 5

Thread: cannot figure out what's gone wrong

  1. #1
    Join Date
    Nov 2006
    Posts
    55
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default cannot figure out what's gone wrong

    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';
    ?>

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    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 Code:
    <?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.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Nov 2006
    Posts
    55
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    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" ?

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    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.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Nov 2006
    Posts
    55
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default

    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;
    ?>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •