Jump to content

How Do I Make My Directory a Hyperlink?!? Help!


XHTMLboy

Recommended Posts

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

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 by XHTMLboy
Link to comment
Share on other sites

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

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

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...