Blog Spam Bots… Who Actually Lets These Comments Through?

Just a little rant from my end after going through my blog comment spam list…

I am so sick and tired of automated bots slamming my blog TRYING to get their bogus comments in the promote their sites. I mean seriously, unless you’re an idiot and just auto-approve all comments (in which case you should be flogged repeatedly and be cut off by your ISP), who would approve obvious spam comments?

For any of you that are still manually flagging WordPress comments, you can get Akismet for free for personal use (if you’re running a business blog, be honest and just pay for the software). If you look to the right side of my page, you’ll see the number of comments automatically marked as spam since I installed it on September 9th, 2010.

Unfortunately it makes me realize how unpopular my blog is since 99% of my comments are spam, lol.

Convert extended ASCII in a string using PHP strtr instead of Normalizer or iconv

I am working on a CodeIgniter project that has information stored in the database with extended ascii characters (128-255) and UTF-8 encoding. As most of you know, CodeIgniter is fairly strict on what is allowed in a url (they only allow what SHOULD be permitted per RFC 1738 ;)). Furthermore sunce you can create basically any character by allowing a percent sign (%) in the URL, alowing that was not a viable option for me.

For instance you cannot use “ñ” (n with a tilde) in the URL parameters. Replacing it with “n” for the database query will however return a valid match. Problem solved! I can just use Normalizer or iconv, right?

Continue reading

Codeigniter Core Mod for $_SERVER[‘DOCUMENT_ROOT’] on GoDaddy subdomains with $_SERVER[‘SUBDOMAIN_DOCUMENT_ROOT’]

I was tinkering around with a CodeIgniter project earlier today and at some point, I needed to use PHP’s file_exists() function. I tend to use $_SERVER[‘DOCUMENT_ROOT’] for my starting location for finding files located in the web-viewable areas (makes sense huh?). This makes it easy to get the file url by simply replacing the document_root from the path of the filename which results in a nice absolute path for linking. In this particular instance, I was checking for an image to show in place of a heading tag. Granted the code was simple and straight forward, but it could not get PHP to locate the file and I knew it was there.

Continue reading

PHP/MySQL Nested <select> using <optgroup> with LEFT JOIN on same table in a single query.

I looked around on the web for a while trying to find an example of what I was trying to do. Some were close, but none performed the JOIN portion of the query and on the same table from the SELECT portion (self referencing). So, here is the code I used to created a sub-category only dropdown using the parent categories as the optgroup labels.

Continue reading

How to fix dtheatre’s FormMail.php v5.0 form variables

Well, if you’re here you most likey are not getting any data from your FormMail script in the email you received. The problem is that dthetre’s script expects register_globals to be turned on. Since PHP4, most installations have register_globals turned off. This means your script will not work unless the feature is enabled. Most hosts are not likely to enable this feature (we’re one of them).

So here’s a quick workaround for the script. Add this code right after the header section of the script (before “// for ultimate security, use this instead of using the form”).

CODE UPDATED – SEE BELOW

Continue reading

XHTML Compatible Flash Object Tag for IE7 and FF2

I have been all over the web looking for a good solution that will display a flash movie in both Internet Explorer and Firefox. Most of what I have seen are bloated hacks and workarounds. If we just take a look at the XHTML standards set forth by ther W3C, the answer can be found.

Even though there are many attributes that are considered acceptable by the standards, too many designers are over-complicating the problem at hand. Here is an example of a streamlined object tag that works as expected in most modern browsers.

Continue reading

Missing IP address in email reports with (D)DoS-Deflate 0.6

First let me say that the guys over at Media Layer did a great job with (D)DoS-Deflate.

We installed the utility by following their installation instructions on the above linked page. We made on modification to the script by lowering the number of connections allowed to 50 thinking it would be acceptable for normal traffic. Shortly after, we were locked out of our own server… duh. After rebooting our DSL modem to get a new IP address, we quickly logged in and reverted to the suggested count of 150. From our experience, take the advice of the team that wrote the script 😉

The notification emails starting coming through letting us know when IP addresses were being blocked because they had more than 150 connections to our server at one time. After which we noticed the script was reporting the connection count as both the count and IP address.

Continue reading