Jump to content


New Members
  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About yakking

  • Rank
  1. Thanks Ch0cu3r! That's so close to what I am after! With those examples it returns all the folder paths e.g /home/public_html/folder_here/another_folder So if I use basename can I get just the /folder_here/ and not the whole /home/public_html/folder_here/another_folder path? I had a look at the basename examples in the link, is there an example that I would understand?
  2. Thanks QuickOldCar I'll check it out!
  3. Hi Barand Sorry I should have expanded on what I was asking. That above code is in a php file, if you request that php file in a browser it prints/echos the current folder that the php file is in. e.g. /directoy/name/ So what I am asking is there a way to print/echo the folder/directory that the /directory/name/ folder is in I can't think of the terminology, I think its called parent directory. e.g. /folder<--/name/ so the php file is in the /name/ folder I would like to print the /folder/ part. Now heres the catch, the /folder/ can actually be named anything, hence why I need the code to echo/print it, it's not static. Thanks for any help you can provide!
  4. I found a php code that will echo/list the current folder that the file is in: <?php foreach(glob('directoryname/*', GLOB_ONLYDIR) as $dir) { $dir = str_replace('directory/', '', $dir); echo $dir; } ; ?> Is it possible to have the same thing except echo/list the previous folder that the file is in? Thanks for any help!
  5. I've been reading up on "DIE" in PHP when a file is not found you can display a message such as "File not found" etc. So I am trying to work out how to implement it. I have a simple download.php file inside which is <?php echo $_GET["f"]; ?> which prints the URL when called e.g. www.example.com/download.php?f=name.zip So if a file is not found what is the correct code to use in this situation? I don't wish to use a apache rewrite as its not specific to my needs.
  6. Thank you for the replies! Can you recommend some good scripts or database managers? Or should I just go down the blog path, or WordPress?
  7. Yes this is true. After thinking about it for a bit though I'd still rather try and do it as I mentioned in the OP. I know how to do a PHP include, but I'm still working out how to grab the "name=" part to grab the relevant page?
  8. Thanks for the reply! I did also look into databases and all the blog software all use a database to store and retrieve the content. The main reason that I wanted to do it the way I suggested was so that I can just create/edit the content from my own PC from simple html files, then just use the include to grab the contents. Is there a specific PHP code I can use for this?
  9. OK so I am really new to PHP (really really new lol) I'm making a new plant hobby site, I am not really interested in using scripts like WordPress or the other various blogging sites/scripts. I would like to have all my content in html files (or php files it doesnt really matter) so each page of the site would have its own html file. I would then like to have one file that would be the master page, the page that has all the design content in it, then I could just call up each page simply like www.example.com/plants.php?name=fern or www.example.com/plants.php?name=pine. So when any of those URL's are used it will load the content from the corresponding html file e.g. fern.html or plants.htlm etc. So I've been reading about using PHP includes which I understand how to use, but what I am wanting to do is use a PHP code similar to the <?php echo $_GET["name"]; ?> to grab the "name=" part of the URL that way plants.php looks for the fern.html or plants.html file and includes the content. Am I going about this the right way, or is there a better method? I can bet most people here are laughing at my newbie question, don't blame you really lol
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.