Share your handy snippets of code in this forum – remember to include the code language in the title.
Hello Guys, A couple of people have been asking how to create custom login forms for Helm, since this dosent directly relate to Red Fox Hosting Im posting this in Code Sharing forum (though Helm installations used with this code need to be running at least one Red Fox AddOns theme or skin). ...
Just thought it'd be nice to share these scripts. Yes I know there's better out there - but it should give you something useful to start from. Please feel free to linkback to phorce.co.uk :D dl.php <? ob_start('ob_gzhandler'); session_start(); $files=array(...
I've just thought of a fairly obvious solution to the bug that causes output buffering to break when trying to clean a buffer that uses the ob_gzhandler compression handler. It's a bit crude perhaps; it works on the principle of using a top level buffer with gzhandler, then always using a nested...
I wrote this a while back, I bet there are cleverer ways, but this little function has done me proud. function generatePass($length=8, $include_numbers=false) { $vowels = array("a", "e", "i", "o", "u"); $cons = array("b", "c", "d", "g", "h", "j", "k", "l", "m", "n", "p", "r", ...
I think I said a few days ago that I would offer up some ideas for creating your very own custom error handler in PHP. I have barely tested it, but it seems to work okay. To use the error handler, firstly make sure you have included the class, then add set_error_handler(...
Here are a couple of quick and simple php functions, the first returns the size in bytes contained within the directory that is passed to it, the second function converts the bytes value to a different size unit. <?php function dir_size($dir) { $total_size = 0; $skip = array('.','..','');...
Another code snippet for you all. I like to use the DOCUMENT_ROOT variable in my scripts, it is as if nothing else is ever quite as useful. Unfortunately here at redfox the variable is currently not set, which can be frustraiting. Stick this tiny bit of code so that it is one of the first...
In that mood today, just thought I would post a handy script that I have written and tend to use all the time. It saves a great deal of time and energy when writing large PHP programs. Simply put, it makes use of the __autoload function so that you never again have to load class files manually...
There are currently 1 users browsing this forum. (0 members & 1 guests)
Use this control to limit the display of threads to those newer than the specified time frame.
Allows you to choose the data by which the thread list will be sorted.
Order threads in...
Note: when sorting by date, 'descending order' will show the newest results first.
Forum Rules