WordPress: 404/Page Not Found On Form Posted Data

404-error
I struggled quite a while with this one and there was no specific indication as to what the problem was. I had an HTML form which was submitted and after submitting it, WordPress would show a 404/Page Not Found. I knew it was the $_POST posted form data as the page did exist and accessing

W3TC Fragment Caching MFUNC

UPDATE: Having problems? Fragment caching stopped working? See the updated article with information on using W3 Total Cache fragment caching with the new W3TC_DYNAMIC_SECURITY constant which was implemented for security reasons. W3 Total Cache is a great plugin for speeding up your WordPress website with page cache, database cache, minifying JS and CSS, object cache,

MySQL: Multiple COUNT in one query with conditions

I’m still learning some tricks about MySQL as I go along and figured how to combine multiple COUNT queries into a single query returning one resultset. I wanted to specifically count on the same column/field but each count having it’s own condition on the table and then group the results by a ‘created’ date column

PHP $_COOKIE variable empty

The PHP $_COOKIE variable is a reserved variable and Array in PHP which contains cookies in the browser stored by PHP, Javascript and other languages. If for any reason you are using PHP setcookie() or Javascript document.cookie to set cookies and the PHP $_COOKIE variable remains empty it might actually be a server configuration that

MySQL: Duplicate a column/field

You may need to duplicate an existing column/field in a MySQL table with the exact same values in the new column/field as you have in the current or original column/field. First, you’ll create a new column to the table as needed: ALTER TABLE `tablename` ADD `column2` TEXT NOT NULL; Then you’ll simply execute an UPDATE

Linux: Check inode usage in folders

Inodes are temporarily files stored on your server which are currently in use and not closed. They could be cache, temporary files or anything related and could be created in several different ways. Your server most likely has an inode usage quota (especially on VPS and shared hosting accounts) and if you exceed this it

Safari Tabindex

Safari Tab Index Preferences
By default, Safari ignores the pressing of the tab button on the keyboard to follow the tab index of fields, specifically on checkbox and radio button fields. Here is a video to show the problem: http://screencast.com/t/BsoIZ1Kz You can fix this by going to Safari Preferences > Advanced > Press Tab… Here is a screenshot to show

PHP: Enable GD image library

Many features that you see on the web require that the GD library be enabled on your PHP server. You may need the GD library if you are attempting to display CAPTCHA graphics somewhere on your site. In a default PHP installation, the GD library should already be enabled. The following How To explains how

PHP: Copy image from remote server to local server

You might want to copy an image (or any other file) with PHP from a remote location to your local server and store it in a specific location. You can use the PHP file_get_contents() function to achieve this. Here is a code sample: $remoteimage = "http://domain.com/path/to/remote/image.jpg"; $localimage = "/home/domain/httpdocs/path/to/my/image.jpg"; if ($content = file_get_contents($remoteimage)) { if

WordPress: Add RSS feed to sidebar

You can easily add any RSS feed (remote or local feed) to your WordPress sidebar using a sidebar widget. To do this, go to Appearance > Widgets in your WordPress dashboard and locate the RSS sidebar widget. Then you’ll drag the RSS sidebar widget to one of your sidebars where you would like it to