HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Uploader Questions
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
wallwriter



Joined: 20 Aug 2008
Posts: 2

PostPosted: Wed Aug 20, 2008 1:58 am     Uploader Questions Reply with quote

Hi, this is my first post here. I'm currently trying to build a site for a musician friend of mine. I want to incorporate some uploaders where he can upload pics, music, videos. Each will have a different page. I have the uploader sorted and I've got a bit of script which can display the pictures in a given folder.
{{{{{{{Looks sth like this:
<?
$handle = @opendir("Pictures");

if(!empty($handle))
{
while(false !== ($file = readdir($handle)))
{
if(is_file("Pictures/" . $file))
echo '<img src="Pictures/' . $file . '"><br><br>';
}
}

closedir($handle);
?
}}}}}}}

Is it possible to change this bit so that it displays the music folder instead. Obviously the folder name will be changed from 'Pictures' to 'Music'.
I'm guessing I also need to change sth this line:

echo '<img src="Pictures/' . $file . '"><br><br>';

????

But to what i dont know. Could anyone help me?
Daler



Joined: 23 May 2008
Posts: 53

PostPosted: Wed Aug 20, 2008 2:02 am     Reply with quote

So what are you trying to do?

Do you want to set it so that the files are up for download, or so that they can be played online?
wallwriter



Joined: 20 Aug 2008
Posts: 2

PostPosted: Wed Aug 20, 2008 2:09 am     Reply with quote

I dont think i've thought this through properly:?
I was thinking that the files would list themselves, they could then be clicked on to open in quicktime for example, by right clicking they could be saved to computer. Not sure now that this is the best option.

However, with regard to the initial question. Just the code to list the files in the folder would be enough to answer that.
Daler



Joined: 23 May 2008
Posts: 53

PostPosted: Tue Aug 26, 2008 12:37 am     Reply with quote

What you would have to do would probably manually write in the url of the music files yourself. I'm not sure if they will make the visitor download the files, or if they'll play.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial