displaying jpg and video in php from htdoc ?

Discussion in 'Programming' started by mysoogal, Sep 1, 2009.

  1. #1
    ok i have this idea to read Flv and jpg thumbs from htdoc using php, so far i find great jpg script that read and display output, but now i cant figure how to add also the file location for flv, later on i will embed the vlc player into page, and take the flv location onclick event to pass the url and be able to stream it on page, can someone help me, how can i add the file location so i can also download ,



    <?php
     
     
     
    // Define the full path to your folder, shouldn't need changing
     
    $path = "./"; 
     
     
     
    // Open the folder
     
    $dir_handle = @opendir($path) or die("Unable to open folder"); 
     
     
     
    // Loop through the files
     
    while (false !== ($file = readdir($dir_handle))) { 
     
     
     
    // Prevent this file itself being shown
     
    // If you want it to not display any other files
     
    // enter more of these
     
    if($file == "index.php") 
     
    continue; 
     
    //Prevent folders showing
     
    if($file == ".") 
     
    continue; 
     
    if($file == "..") 
     
    continue; 
     
     
     
    // Display the results
     
    echo "<img src='$file' alt='$file'><br />"; 
     
     
     
    } 
     
     
     
    // Close it
     
    closedir($dir_handle); 
     
     
     
    ?> 
    
    Code (markup):


    hmm i think i find it here but now how to integrate it together

    <?php

    $dir=""; // Directory where files are stored

    if ($dir_list = opendir($dir))
    {
    while(($filename = readdir($dir_list)) !== false)
    {
    ?>
    <p><a href="<?php echo $filename; ?>"><?php echo $filename;
    ?></a></p>
    <?php
    }
    closedir($dir_list);
    }

    ?>
     
    Last edited: Sep 1, 2009
    mysoogal, Sep 1, 2009 IP
  2. jjwdesign

    jjwdesign Peon

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    For the FLV playback, check out the Flow Player.

    Jeff
    JJW Web Design
     
    jjwdesign, Sep 2, 2009 IP