PHP has a pretty neat built-in class called ZipArchive that lets you create zip files on a web server at run-time. In a recent update to the END[SEVEN] Cloud, I completely automated the packaging process for downloadable class files and examples using the ZipArchive class. How to use this function: This function accepts an array [...]
This class has been four years in the making. It started as a very simple script when someone asked me to create a way to send email messages between users on their website. Over time, more features were added until it ultimately became what it is today. This class presently supports multiple file attachments, multiple [...]
Sometimes you’ll need to calculate an age. It could be the age of a member on your website… It could be your cat. Either way, this can be useful for a variety of reasons such as personalized messages, criteria-based marketing or any functionality that is based on age demographics. I’ve seen a few different versions [...]
I was recently asked to write a function that implodes a list of items in an array into a human-readable list. For example, [[0] => “Jimmy”, [1] => “Ryan”, [2] => “Ken”, [3] => “Barbie”] would become “Jimmy, Ryan, Ken and Barbie” and [[0] => “apple”, [1] => “banana”] would become “apple and banana”. This [...]
Email addresses are used for everything. Registrations, usernames, lead generation… Everything. They are as unique as a telephone number or physical address and require validation just like any other piece of data. I’ve come across a lot of poorly written email validation scripts, but this one has risen from the ashes in a blazing glory [...]
Have you ever typed a URL into an email or website and a clickable hyperlink was automagically created? Regular expressions, baby! Check it out: This function accepts three arguments; $sInput, $sTarget (optional), and $sClassName (optional). $sInput is the text you would like to search and create hyperlinks for, $sTarget is the target window that hyperlinks [...]
Sometimes you just need to shorten that huge wall of text. Here are two functions that I use frequently to limit the display of lengthy user input: The first function, jTruncate(), truncates text if it is greater than the specified number of characters. For example, if you pass “This is a large block of text!” [...]
For as long as I can remember, I’ve loathed .DS_Store and Thumbs.db files. They always seem to crawl their way onto my hosting servers. By definition, the .DS_Store file is “a hidden file created by Apple’s Mac OS X operating system to store custom attributes of a folder such as the position of icons or [...]
I’ve recently started programming an international traveling website that accepts input from users all over the world. Since it’s likely that users will type in their native language, the functionality to accept accented characters became an absolute necessity. I’ve recently incorporated some of this new functionality into the MySQLGoodies class for PHP. This class is [...]
This page was loaded in 0.0957 seconds! Go ahead, refresh this page and the load time value you just read will change. This is possible because I wrote a WordPress plugin that calculates the time it takes to load a page from start to finish. This is the first plugin I have ever created for [...]
I use a lot of the same functions over and over again for almost every project I work on. A perfect example of what I’m talking about is MySQL-related functions. One day I asked myself, I said, “Self. Why are we hunting for previously-written functions, copying them, and pasting them into the project folder?!” I [...]
Back in 2008, I wrote an article that explained how to connect to a media server and publish or stream live audio and video using Real Time Messaging Protocol. If you’re interested in writing your own webcam delivery, surveillance or online audio/video chat application, this article can definitely help get you started. This article assumes [...]
In an article on my previous blog, I covered how to take an image with your webcam and upload it to your web server using ActionScript and PHP. This article was always very popular, so I have decided to bring it back to life with updated programming and include it in this new blog. My [...]
During my internet travels, I have gathered bits and pieces of code and have compiled my preferred XHTML template for starting new web projects into this article for anyone looking for new tips and tricks. I know some readers will agree with this article and some will completely refuse to accept it. In any case: that’s completely okay! We all have our own definitions of what’s “standard” and our preferred way of writing code.
I wrote an article previously that outlined the process I personally use to track post views using WordPress. This is an updated version of that article. There were multiple things wrong with my previous method of tracking post views that I have addressed in Version 3.1.1 of my WordPress theme and I am going to [...]
|