How to change drupal theme from url

Here I give just simple example to change themes via your site URL.
It might be help full when you will create multi-language site.

/*switch.info*/
name = switch
package = switch
core = 6.x
description = "Your Desc"
version = "6.x-1.0"
core = "6.x"
project = "switch"

/*switch.module*/
<?php
function switch_init() {
    global $custom_theme;
    $language = $_GET['lang'];
    switch($language){
    case "eng":
        $custom_theme = 'marvin';
        break;
    case "hin":
        $custom_theme = 'minnelli';
        break;
    default:
        $custom_theme = 'garland';
    }
  }
?>

Try Link like http://<drupal site>?lang=eng

Tags: 
X