<?php
//Joomla 2.5
$jinput = JFactory::getApplication()->input;
$option = $jinput->getCmd('option', '');
$view = $jinput->getCmd('view', '');
$layout = $jinput->getCmd('layout', '');
$task = $jinput->getCmd('task', '');
$itemid = $jinput->getCmd('Itemid', '');

//Joomla 1.5
$option = JRequest::getCmd('option', '');
$view = JRequest::getCmd('view', '');
$layout = JRequest::getCmd('layout', '');
$task = JRequest::getCmd('task', '');
$itemid = JRequest::getCmd('Itemid', '');
?>