Skip to main content


Showing posts from April, 2012

HOSTGATOR - World's most trusted and reliable webhosting Team

HOSTGATOR - World's most recommended webhosting Providers

Webmasters around the globe trust Hostgator as best of the bestest Web hosting providers in the world. One of the main factors in their success is the minimum downtime. The UP-Time statistics of HOSTGATOR is around 99 to 100 %. Most of the reviews in the NET world points out HG as the best Webhost service.

 HG Provides a 24/7 support, live chat support and toll free phone services which makes it one of the best customer friendly service provider. They are the fastest growing and the most recommended web hosting service. They have shared hosting, Virtual Private Server VPS plan, dedicated servers and reseller hosting plans. They provide services in both Linux hosting and Windows hosting.

Their after sales service is excellent. Hostgator support team are now available via live chat on-line, via phone support and email support as well. They are available 24/7. The Hostgator plans are covered by 45-days money back guarantee, …

Ajax file / image upload using Jquery and preview the uploaded image without refreshing page

Ajax file/image upload and preview without refreshing page using Jquery.

Here is a good and simple illustration of file upload using Jquery, This save much time of your coding with messy upload codes. Here you can upload the file / image and preview the uploaded image with out refreshing of the page.

With just few lines of JavaScript code, you can upload files, image and videos.

This script uses "jquery.min" and "jquery.form" plugin

Understanding Wordpress Db structure - Wordpress category - taxonomy issue

How to solve Wordpress category - taxonomy issue

There was some problems which happened when old wordpress table was integrated with the New wordpress Db, the Categories, tags and links were not displaying. When i googled for this there was some interesting posts, which can be referred to solve this issue. All the things you see  are taken from different sources.

Provided below are just links to the actual source. You can refer this to get an idea about this and solve the issue yourself.

Understanding Wordpress table structure

wp_terms : The categories for both posts and links and the tags for posts are found within the wp_terms table.

wp_term_relationships : Posts are associated with categories and tags from the wp_terms table and this association is maintained in the wp_term_relationships table. The association of links to their respective categories are also kept in this table. 

wp_term_taxonomy: This table describes the taxonomy (category, link, or tag) for the entries in th…

Google / Search redirect virus - How to remove google search redirect viruses - Download the complete fix

Google / Search redirect virus

Google redirect virus is a silent malware which redirects you to random websites your searches to random websites by infecting certain drivers on your computer.

The Search redirect virus is one of the most common viruses infecting millions of computers around the Globe. It has been designed brilliantly by expert hackers, it is highly annoying and will continually redirect your web searches to fake websites. The main reason why this virus is is one of the most damaging is that it cannot be removed with traditional antivirus programs. Instead, you need to use special methods or tools to get rid of it.

What virus can do:

The virus can change Internet Explorer's Proxy Settings so and redirect your searches to random websites.

It can infect certain drivers on your computer or install hidden services to redirect you to random websites.

It can change settings of hosts file In Windows so that when you open Google, a fake website will open which will look just…

Function to generate an seo friendly url - Clean url function in php

Function to generate an seo friendly url from the supplied string


    $cleaned_str = preg_replace('/\%/',' percentage',$untouched_str);  //replace '%' with 'percentage'
    $cleaned_str = preg_replace('/\@/',' at ',$cleaned_str);  //replace '@' with 'at'
    $cleaned_str = preg_replace('/\&/',' and ',$cleaned_str); //replace '&' with 'and'
    $cleaned_str = preg_replace('/\s[\s]+/','-',$cleaned_str);    // Strip off multiple spaces
    $cleaned_str = preg_replace('/[\s\W]+/','-',$cleaned_str);    // Strip off spaces and non-alpha-numeric
    $cleaned_str = preg_replace('/^[\-]+/','',$cleaned_str); // Strip off the starting hyphens
    $cleaned_str = preg_replace('/[\-]+$/','',$cleaned_str); //  Strip off the ending hyphens
    $cleaned_str = strtolower($cleaned_str); //convert to lowercase


Following are the commonly php functions to get the path information of a file


realpath(string $path)
realpath — Returns canonicalized absolute pathname
Function realpath() expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in the input path and return the canonicalized absolute pathname.

Usage :
$realpath = realpath('./../../etc/passwd');


pathinfo() returns information about path: either an associative array or a string, depending on options.

Usage :
$path_parts = pathinfo('/www/htdocs/inc/');

the extension of the file will be in $path_parts['extension']

More info

dirname ( string $path )
dirname — Returns parent directory's path. Given a string containing the path of a file or directory, this fu…

MySQL Query for getting nested items in a single query

MySQL Query for getting nested items in a single query

 Here I would try to explain this with an example of categories , subcategories and maincategories which is handled via a nested structure in the table

How to get subcategory name , category name  and main category name in a single MySQL query

Suppose your category structure is like


and You have a category table structure like this:

Table Name: tbl_category
CatId integer Autoincrement primary
CatName Varchar(25)
CatParent integer
CatSubParent integer
CatActive  integer

Suppose You have a category table with values like this

Understanding the nested table structure for storing categories , subcategories and maincategories in a single table

catId , catName , catParent , CatSubParent
1 , Books , 0 , 0
2 , DVD , 0 , 0
3 , Science , 1 , 0
4 , Maths , 1 , 0
5 , Movies , 2 , 0
6 , Music , 2 , 0
7 , English Movies , 2 , 5
8 , Malayalam Movies , 2 , 5
9 , Algebra , 1 , 4
10 , Physical Science …

Urgent Openings for PHP trainees, Andriod / IOS developers and PHP developers in Kochi Trivandrum Calicut and Bangalore. Please Send Your updated resumes to   Read more »
Search This Blog