February 2010

Email Marketing Statistics and Optimization of Open / Click Rates

A quick post to share with my readers some interesting findings regarding email marketing. Outlined by the ninth bi-annual Email Marketing Metrics Report by MailerMailer, these data is based on 300,000 email messages dispatched over a period of 6 months that ended on December 31, 2008. Here are some key statistic discoveries from the report …

Email Marketing Statistics and Optimization of Open / Click Rates Read More »

Use PHP to handle all incoming URL requests in a SEO friendly manner

While you can always use .htaccess and the mod_rewrite module to map SEO friendly URLs to actual PHP parameterized URLs with question marks and ampersands, you can simply put these lines in .htaccess and then rely on PHP entirely to recognize and handle all incoming URL requests of any kind / form: <IfModule mod_rewrite.c> RewriteEngine …

Use PHP to handle all incoming URL requests in a SEO friendly manner Read More »

PHP: Get the File Uploading Limit – Max File Size Allowed to Upload

PHP file upload max size is determined by 3 configuration values in php.ini, namely upload_max_filesize, post_max_size and memory_limit. You can get the maximum file size allowed in uploading by this snippet: $max_upload = (int)(ini_get(‘upload_max_filesize’)); $max_post = (int)(ini_get(‘post_max_size’)); $memory_limit = (int)(ini_get(‘memory_limit’)); $upload_mb = min($max_upload, $max_post, $memory_limit); Wherein $upload_mb is the maximum file size allowed for upload …

PHP: Get the File Uploading Limit – Max File Size Allowed to Upload Read More »

PHP: Display Current Year to Automatically Update Copyright Years

I guess most of the websites out there are using plain strings for the years of footer copyright because many of them are still showing 2009 right now. If you have quite a few websites as I do, it’d be kind of intimidating to manually update the copyright years for all of them. So why …

PHP: Display Current Year to Automatically Update Copyright Years Read More »

Use stat command to display file system meta information of any file or directory under Linux

PHP has a stat() function that returns an array containing the meta information of a file such as owner, size, time of last access, last modification or last change. It’s basically the stat command under Linux that returns and shows the file system meta information of any file or directory: stat myfile.txt Which returns: File: …

Use stat command to display file system meta information of any file or directory under Linux Read More »

How to slow down the frequency Googlebot (search engine crawler) visits your site?

Googlebot is the indexing program of Google that visits your site to fetch the content to determine your search engine rankings. With a popular website, tens of thousands of pages can be a problem in that Googlebot may visit more than you want because it’s expending your precious bandwidth and even crashing your server. Every …

How to slow down the frequency Googlebot (search engine crawler) visits your site? Read More »

PHP: Allow Specific HTML Tags in Text Input Controls of HTML Forms, <textarea>, <input type=”text” />

Textarea and text input are common html form controls that accept text input. They can be a security challenge as they allow the user to enter anything they want. If you just go about using whatever data the user has entered, your application is anything but secure. Some sort of filtering / white-listing must be …

PHP: Allow Specific HTML Tags in Text Input Controls of HTML Forms, <textarea>, <input type=”text” /> Read More »

A few database security tips – things to do to effectively protect MySQL databases

I’d like to share with you some tips about hardening the database part of your application. Here are a few things you can do in protecting the databases from being compromised in security: Create separate users with ONLY necessary privileges (as few as possible) to connect to the database for common daily tasks. Never use …

A few database security tips – things to do to effectively protect MySQL databases Read More »

PHP: Why you should use dirname(__FILE__).‘/include.php’ instead of just ‘include.php’

When you need to include or require a php file that is in the same directory as the currently running one, most people come up with this simple line in the current script: include(‘include.php’); While this approach doesn’t present obvious breaches, it is slightly inefficient than the following way: include(dirname(__FILE__).’/include.php’); You will type a little …

PHP: Why you should use dirname(__FILE__).‘/include.php’ instead of just ‘include.php’ Read More »

Scroll to Top