PHP snippets and tips. This can be for PHP 4x and 5x, it will state compatibility.
This short PHP snippet shows how to remember form values when submitted through the post method. For a demo just copy and paste the code and test in your browser.
This little snippet allows you to list all the domains that you may have enabled in your Apache set-up. I decided to create this code when I was tidying up files on my PC and thought that this was a good way to check what content and site was still alive. There are a couple of things to note/change in the script, but it should run almost as is.
After about 3 weeks of playing with Drupal v6 I have finally figured out how to add accesskeys to $primary_links. In this article I will show you how to do this and also how to add the keys to previous versions of Drupal too. Why this little step seemed so hard to achieve is beyond me - though none-the-less we are there how.
This script is a directory lister that shows whatever files you want using the glob PHP function. It can be configured to show as many or as little files per page are you want. You can also exclude certain directories of your choice. The pagination part perhaps needs a little attention but you should be able to work thing out OK.
In this snippet we print out the Apache modules that are running on the server.