PHP Archive

  • PHP: Easy to use logging class for your scripts.

    PHP: Easy to use logging class for your scripts.

    Often for my work I am always having to add logging to most of my scripts so I had to create a simple plug and play script that will simply things to do this for me. This script below is rather clean and easy to handle your logging needs. The class also handles timestamps when [...]

    Read More

  • PHP: GIF animation splitter (Split any GIF animiations – frame by frame properly!)

    PHP: GIF animation splitter (Split any GIF animiations – frame by frame properly!)

    I have been looking for a GIF animation splitting script for quite awhile, but have not found any luck with any basic ones. There has been a couple but they do not process GIF animations properly anymore, because GIFs now are optimized etc You will end up getting frames that aren’t ‘complete’ frames because they [...]

    Read More

  • PHP: Multiple submit button choices in a single FORM

    PHP: Multiple submit button choices in a single FORM

    This one is just posted mainly for a friend. He did not understand how to process data differently depending on the submit button clicked, only using ONE HTML FORM. Many people would end up making multiple forms on one or many pages to solve this, which can get rather messy or annoying. There is a [...]

    Read More

  • PHP: Randomizing a text file using PHP + MYSQL, quickly & efficient

    PHP: Randomizing a text file using PHP + MYSQL, quickly & efficient

    I had one person approach me recently about my previous blog entry, stating that you cannot process randomization quickly in MYSQL because SELECT * FROM tablename ORDER BY RAND()"; would take horribly long to process when you have a large amount of records stored in a database. This is very true! RAND() is very slow [...]

    Read More

  • PHP: How to get a random image to display from a specific folder

    PHP: How to get a random image to display from a specific folder

    So you have a folder full of images, and now you want to display a random image? No problem. There are a few examples you can find around online. However, for alot of the examples, you need to input the set amount of images that are actually in the folder, which can get annoying if [...]

    Read More

  • Randomizing Large Text Files in PHP with low RAM usage and no database

    Randomizing Large Text Files in PHP with low RAM usage and no database

    Randomizing a text is normally a easy feat in PHP, the first example is a standard way to load and randomize text files with PHP with no database and is rather simple to grasp: ?View Code PHP$lines = array();   //Open text file for reading $fileopen = fopen("myfile.txt", "r");   //Load lines into a array [...]

    Read More

  • Lightbox Gone Wild – Post/Get Form Submission Issues?

    Lightbox Gone Wild – Post/Get Form Submission Issues?

    I found a neat little LIGHTBOX system my boss wanted to use, which is called Lightbox Gone Wild, located at: http://particletree.com/features/lightbox-gone-wild/. Overall, this lightbox system is very easy to understand and I did not have a hard time modifying the coding to what was needed for my work. You can see an example of how [...]

    Read More