how to create links automatically for items in a folder

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amitdubey2
Forum Commoner
Posts: 48
Joined: Tue Apr 13, 2010 10:13 pm

how to create links automatically for items in a folder

Post by amitdubey2 »

hello all,

I am making a upload / download form for my website.But i am facing a problem ...
Till now i am able to upload and download data...But the thing is when i upload some data it is storing in the "data" folder specified by me..i want when someone upload something it must be available for download at that moment...Now i am manually making links for every item which is uploaded to that data folder...(i am using the same "data folder" for downloading..)
But till now i have to specify the name every time like..
<a href="http://localhost/download/download.php?f=[u]gp1.jpg[/u]">click here</a>

Is there some way to get the item name in the link automatically when it is uploaded by somebody.

Any Clue regarding this??
mikosiko
Forum Regular
Posts: 757
Joined: Wed Jan 13, 2010 7:22 pm

Re: how to create links automatically for items in a folder

Post by mikosiko »

this will give you a start point

http://php.net/manual/en/function.readdir.php
amitdubey2
Forum Commoner
Posts: 48
Joined: Tue Apr 13, 2010 10:13 pm

Re: how to create links automatically for items in a folder

Post by amitdubey2 »

Thanks,,, Mikosiko :D :)

i got the point. :lol:




Thanks
amit :drunk:
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: how to create links automatically for items in a folder

Post by Eran »

Post Reply