XHTMLboy Posted January 10, 2013 Share Posted January 10, 2013 Hey guys, tomorrow I'm handing in my assignment but my tutor didn't teach us much about the languages. SO far I've got most of it working, but where you can create a directory you have to be able to lick on it to open it up in a new window. Seen as I don't know how to use PHP yet, can you guys help me, I would be really gratefull. Their is a link to what I've done so far. I'm also suppose to be able to edit the files inside the directory on the website inside a text area, but I will try my best to do that as I don't want to waste your time. And thanks for taking a look Link to comment Share on other sites More sharing options...
jeffman Posted January 10, 2013 Share Posted January 10, 2013 where you can create a directory you have to be able to lick on it to open it up in a new window. I'm not 100% sure what you mean, but it sounds like a LOT of work. Link to comment Share on other sites More sharing options...
XHTMLboy Posted January 10, 2013 Author Share Posted January 10, 2013 (edited) What I mean is, when you create a directory it then tells you the directory location on my index.php, what I want is for that to be a link so it will open in a new window. When I say a new window I don't mean a new tab inside a browser, I mean a normal window as to where the new folder is created. And thanks Edited January 10, 2013 by XHTMLboy Link to comment Share on other sites More sharing options...
justsomeguy Posted January 10, 2013 Share Posted January 10, 2013 You can use a DirectoryIterator to open a directory and loop through the contents. For each item, you can test if it's a directory, a file, etc, and get the properties of it. You can use that to print a list of the directories inside another directory, and if those directories are accessible on the web server then you can provide links to them which will show their contents. You wouldn't use a web page to open something like the regular Windows Explorer to look at the contents of the directory, the entire file browser would be part of the web page. http://www.php.net/manual/en/class.directoryiterator.phphttp://www.php.net/manual/en/directoryiterator.construct.phphttp://www.php.net/manual/en/directoryiterator.isdir.php Link to comment Share on other sites More sharing options...
XHTMLboy Posted January 10, 2013 Author Share Posted January 10, 2013 I don't know how to make it, basically all I want is a way to open a .txt file into a textarea and so it's editable and then so I can save it back out. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 10, 2013 Share Posted January 10, 2013 You can use file_get_contents to read the contents of a file and put it wherever you want. Once they submit the form then you can get the value they submitted and use file_put_contents to write it back to the file. http://www.php.net/manual/en/function.file-get-contents.phphttp://www.php.net/manual/en/function.file-put-contents.php 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