Jump to content

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


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 post
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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...