make listed files a link

Hello people,

I’m the biggest noob around here and would really aprisiate some help if possible.

I have created a website that look like this:
and I managed to list the files in the upload folder.

$dir = dir("upload");

while (($file = $dir->read()) !== false)
echo "Video name: " . $file . " <br /> ";



Now I want them to be a links to a site that looks like this:

so every file in the list automaticly opens a site and shows the right video.

if you cant help then please give me a hint or a dumb answer and I might figure it out myself hehe ;)


<?php $dir = dir("upload"); while (($file = $dir->read()) !== false) { if($file[0]!='.') echo 'Video name: ' . $file . '
'; } $dir->close(); ?>

… to get rid of the ‘…’ and ‘.’ as well

now rename video.htm to video.php

and in there use:

<PARAM NAME="FileName" VALUE="<?php echo(urlencode(basename($_GET['video']))) ?>">


<EMBED TYPE="application/x-mplayer2" SRC="<?php echo(urlencode(basename($_GET['video']))) ?>" NAME="MediaPlayer" WIDTH="800" HEIGHT="600" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0">

Thank you very much for your time and teaching me this.

it almost works perfecktly =)

its just that the video wont play when I klick play now.

hope u have seen that i have forgotten the path:
SRC=“upload/<?php echo(urlencode(basename($_GET['video']))) ?>”
NAME=“FileName” VALUE=“upload/<?php echo(urlencode(basename($_GET['video']))) ?>”>

Sponsor our Newsletter | Privacy Policy | Terms of Service