Sep 14, 2008
.htaccess | Tutorials & Resources

Loading ...
Just add the following code to your .htaccess file in the highest folder of your web directory and yor visitors will be forced to use the www version.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.your_domain.com$
RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]
Aug 21, 2008
Code Snippets | PHP | PHP | Tutorials & Resources

Loading ...
Simple code snippet to retrieve remote webpage information, including page title, page description, and keywords
<?php
$url = “http://www.leungeric.com/”;
$fp = fopen( $url, ‘r’ );
$content = “”;
while( !feof( $fp ) ) {
$buffer = trim( fgets( $fp, 4096 ) );
$content .= $buffer;
}
$start = ‘<title>’;
$end = ‘<\/title>’;
preg_match( “/$start(.*)$end/s”, $content, $match );
$title = $match[ 1 ];
$metatagarray = get_meta_tags( $url );
$keywords = $metatagarray[ "keywords" ];
$description = $metatagarray[ "description" ];
echo “<div>URL: $url</div>\n”;
echo “<div>Title: $title</div>\n”;
echo “<div>Description: $description</div>\n”;
echo “<div>Keywords: $keywords</div>\n”;
?>
Jul 31, 2008
MySQL | PHP | Tutorials & Resources

Loading ...
Just add below line after MySQL connection is establisted:
mysql_query(”SET NAMES utf8″);
Jul 30, 2008
MySQL | Tutorials & Resources

Loading ...
A simple 3-steps procedure to import/restore large MySQL data file via command line.
A 200mb data file should take less than a minute to complete.
1. Telnet or SSH to server
2. Login to MySQL
mysql -u user -ppassword
3. At MySQL prompt
use your_database_name
source your_sql_data_file.sql
Jun 23, 2008
Tutorials & Resources | WordPress

Loading ...
This plug-in retrieves Clicky statistics of your website via Clicky API 2.0 with cache supported.
You may define:
- Types of statistics to be displayed
- Statistics date range
- The maximum number of results that will be returned
- Cache timeout duration
- Multiple string replacements
Before using this plugin, you need to register a Clicky account, and setup Clicky WordPress Plugin.


(Read more)
Jun 21, 2008
Tutorials & Resources | WordPress

Loading ...
While you are customizing/developing your WordPress theme, if you found children=0 paramter is not working with wp_list_cats() function (deprecated), you should use wp_list_categories() function instead.
It’s important to note their parameters are different, comparison as below:
(Read more)
Jun 19, 2008
Code Snippets | PHP | Tutorials & Resources | WordPress

Loading ...
Make a call to the Feedburner API requesting the feedcount for a given burned feed.
(Read more)
Jun 15, 2008
.htaccess | Tutorials & Resources

Loading ...
.htaccess (Hypertext Access) is the default name of Apache’s directory-level configuration file. It provides the ability to customize configuration directives defined in the main configuration file. The configuration directives need to be in .htaccess context and the user needs appropriate permissions.
(Read more)
Jun 14, 2008
Tutorials & Resources | WordPress

Loading ...
Here is a list of recommended WordPress plugins, which are also being used on this site.
(Read more)
Jun 14, 2008
.htaccess | Tutorials & Resources | WordPress

Loading ...
If your WordPress 2.5 installation shows an HTTP Error when uploading files using the media uploader, this is due to mod_security on the async-upload.php file which handles file uploads.
Just add a few lines to WordPress’ .htaccess file should fix that problem.
(Read more)