Category Archive: PHP
Posts about PHP
Here we have a simple and effective PHP function that checks whether or not HTTPS (via SSL) is used for the current request.
I am always using this PHP code snippet, which basically loops through an array that may or may not include nested arrays. So to make things easier, I am posting here for quick reference.
On the Web, Cross-Site Scripting (XSS) is one of the most common types of attacks. Fortunately, there is an easy fix: always filter input data and always escape output data.
A couple of functions used at htaccessbook.com to enable unescaped/unencoded pre and code tags in bbPress forum posts.
Twitter changes their API quite a bit, however it is still possible to display a simple “tweet this” link anywhere on your web pages.
When working with the WP API, you may need to check the current version of PHP to ensure compatibility.
This post provides a couple of PHP code snippets that enable you to send emails from a text file. Send in plain-text format and plain-text with embedded image.
When testing my plugin, Simple Ajax Chat (SAC), I use the following script to save time testing various chat functionality. Posted here in case it’s useful for others. Note this is for the free version of SAC. Enjoy!
Quick code snippet for detecting all versions of good ’ol IE (Internet Explorer).
Here are a couple of quick snippets to get the visitor’s actual IP address via PHP.
Quick snippet for checking whether or not PHP’s cURL is available on the server.
Quick SQL code snippet that enables you to truncate any MySQL database table.