~n[EO]n~ Posted October 12, 2007 Share Posted October 12, 2007 I got this code <?php $langFlag=false; $QueryString=""; foreach ($_GET as $key => $value) { $value = urlencode(stripslashes($value)); if($QueryString!="") $QueryString .="&"; $QueryString .= "$key=$value"; } $pageName=basename($_SERVER['PHP_SELF'] ); $pageFrURL ="../".$pageName."?".$QueryString; $pageEnURL ="./english/".$pageName."?".$QueryString; $pageRuURL ="../russian/".$pageName."?".$QueryString; if($langFlag==false){ if($QueryString!=""){ $pageFrURL .="&"; $pageEnURL .="&"; $pageRuURL .="&"; } } ?> for multiple language site, french is default and is in the main folder, and other are in their respective folder. And i have a page named footer.php which i included in all page. While clicking on the respective flag link it goes to the same page which is being viewed. My problem is that and "?" comes in the link when i switch page and i don't see the ? in the above code. I got some pages from where i have passed the value like mysite.com/abcd.php?page=abc but while switching ? comes in the end like mysite.com/abcd.php?page=abc?. Will this extra "?" create a problem later or not, till now it is working but I am still in doubt ( i found this code in one site) .... Thanks Quote Link to comment https://forums.phpfreaks.com/topic/72905-can-you-explain-this-please/ Share on other sites More sharing options...
tempi Posted October 12, 2007 Share Posted October 12, 2007 I recommend you $_SERVER['QUERY_STRING'] If you have www.site.com/site.php?a=1&b=2 QUERY_STRING gives you a=1&b=2 So you can build new querystrings like "www.site.com/site.php?c=3&".$_SERVER['QUERY_STRING'] Hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/72905-can-you-explain-this-please/#findComment-367692 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.