im trying to sort categories and subcategories with list explode, but getting
Undefined offset: 1
this is a part of code
$squery = $_SERVER['QUERY_STRING'];
$smarty->assign('query', $squery);
list($str, $trash) = explode('&', $squery, 2);
list($category, $subcategory) = explode('=', $str, 2);
switch($category)
{
case 'locale':
$_SESSION['locale'] = $subcategory;
checklocale();
header('Location:'.($_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : '.'));
break;
default:
include 'main.php';
break;
}
Can you please tell me what i'm doing wrong