Net123 Posted April 4, 2011 Share Posted April 4, 2011 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 More sharing options...
justsomeguy Posted April 4, 2011 Share Posted April 4, 2011 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 Link to comment Share on other sites More sharing options...
Net123 Posted April 5, 2011 Author Share Posted April 5, 2011 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 More sharing options...
birbal Posted April 5, 2011 Share Posted April 5, 2011 (edited) what is id refering here? id of directory or file? are you storing the file in filesystem or database? Edited April 5, 2011 by birbal Link to comment Share on other sites More sharing options...
Net123 Posted July 18, 2012 Author Share Posted July 18, 2012 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 More sharing options...
birbal Posted July 18, 2012 Share Posted July 18, 2012 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 More sharing options...
Net123 Posted July 18, 2012 Author Share Posted July 18, 2012 ok thanks for your help let i try Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now