mysql - Undefined index PHP Error/Warning -
i getting following error on php & mysql application joomla , jomsocial:
[05-apr-2013 12:23:45 america/denver] php notice: undefined index: query in /home2 /robervl4/public_html/forum/components/com_community/community.php on line 50
this did not work out of box. application displays products database should, problem error.
here php code of file, line 50 being:
parse_str($parts['query'], $qstring);
code:
// disable format=feed 17jan13 requested fuqaha $mainframe = jfactory::getapplication(); $jinput = $mainframe->input; $viewtype = $jinput->request->get('format', 'html','none'); if(strtolower($viewtype)=='feed') { $u = jfactory::geturi(); $parts = parse_url($u->tostring()); parse_str($parts['query'], $qstring); unset($qstring['format']); $parts['query'] = http_build_query($qstring) ; //recompose url redirect $scheme = isset($parts['scheme']) ? $parts['scheme'] . '://' : ''; $host = isset($parts['host']) ? $parts['host'] : ''; $port = isset($parts['port']) ? ':' . $parts['port'] : ''; $path = isset($parts['path']) ? $parts['path'] : ''; $query = isset($parts['query']) ? '?' . $parts['query'] : ''; $fragment = isset($parts['fragment']) ? '#' . $parts['fragment'] : ''; $mainframe->redirect(croute::_("$scheme$host$port$path$query$fragment")); exit('redirecting non-feed page'); }
parse_url
include index if has value. i.e., if there no query, $parts['query']
not set. test if set first: if (isset($parts['query'])) parse_str($parts['query'], $qstring);
Comments
Post a Comment