urldecode the db name if (isset($lightm_db)) { $db = urldecode($lightm_db); unset($lightm_db); } $url_query = 'lang=' . $lang . '&server=' . $server . (empty($db) ? '' : '&db=' . urlencode($db)); ?>