Jump to content

reterive date a specified folder ?


Net123

Recommended Posts

now i am working in creating a new auto index (mobile downloading) scriptnow my problem is getting datas for a specified folder i mean if a user clicks my.com/index.php?id=17index.php is a folder page (not gettng info for a file)and i wanna reterive folders and files for under the folder using php/mysql how can i do that??i used infolder coloum for add the info's about the under path and i tried to retrive but i can't do thatyou have any ideas i wanna talk to some webmaster please invite me in gtalk maniboysworld@gmail.comor please reply me here ......................

Link to comment
Share on other sites

Once you have the folder path, you can use the scandir function to retrieve a list of files and folders inside the target folder.http://www.php.net/manual/en/function.scandir.php
yeah but i wanna give the link using mysql not direct link ............like somesite.com?id=14
Link to comment
Share on other sites

what is id refering here? id of directory or file? are you storing the file in filesystem or database?

Edited by birbal
Link to comment
Share on other sites

  • 1 year later...

no any files are stored in sql just save the links ...... i am making auto index scriptlike our forum script...if an user click in php folder then retrive under folders like=>php folderunder folder=>php/mysqlunder files=>files

Link to comment
Share on other sites

where you saving the links it have id for each row. right? on the proccessing page (the requested page) nyou have to get the id from the url using $_GET superglobal array. and using it you have to query the databse where it matches the id. once match found you can get the location and you can use it do any work on that directory. like if you want to get subdirectory of that specified directory you can use glob() for that. http;//php.net/glob

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...