Embed with PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • miguel22
    New Member
    • Jan 2008
    • 13

    Embed with PHP

    Is there anyway to embed video using just PHP and not HTML? I want to hide the source of my video files.

    Thank you.
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Imposible, so to speak.

    For the browser to be able to show the embeded element, it has to be able to read it. Therefore, it has to be in the source!

    Comment

    • dlite922
      Recognized Expert Top Contributor
      • Dec 2007
      • 1586

      #3
      Originally posted by miguel22
      Is there anyway to embed video using just PHP and not HTML? I want to hide the source of my video files.

      Thank you.
      Encrypt html source, protect javascript, asp encryption, web site password protection email scramble



      -Dan

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        If you just want to hide the source of your video files, that is to say, their actual URL, then you could pass them through a PHP file.

        Like, say:
        [code=php]
        <?php
        # Assuming the URL is somewhat like:
        # page.php?vid=so mevideo.wmv
        $videoName = $_GET['vid'];
        $videoDir = "path/to/the/video/";

        $fullPath = $videoDir . $videoName;

        header("Content-Type: video/x-ms-wmv");
        header("Content-disposition: inline; filename={$vide oName}");
        header("Content-length: ". filesize($fullP ath));
        readfile($fullP ath);
        exit();
        ?>
        [/code]
        Using the GET parameter in such a way is a very crude method of doing this. In a real application I would store the video names in a database of some sort and pass along ID's rather than their actual names.

        This will obviously not protect the file from being downloaded. That would be a practical impossibility.
        If you want your file to be accessible to the browser, it must also be available for download. That is just how it must be.

        You can try to mess it up and have people jump through hoops to get to it, but it will eventually just cause extra work and problems for you.

        Comment

        Working...