~n[EO]n~ Posted October 11, 2007 Share Posted October 11, 2007 Hi all, I am having one problem, I thought for whole day but still cannot find the solution. So, you guys are gonna help me right My site has 2 languages English and French, now what is needed is that if the User is in abcd.php page which is in French and clicks on the English link he should go to the same abcd.php in English Language. How to do that is it possible cause I have around 40 pages means (80 in 2 language) Any idea guys ??? Quote Link to comment https://forums.phpfreaks.com/topic/72749-solved-help-on-this-problem-please/ Share on other sites More sharing options...
Orio Posted October 11, 2007 Share Posted October 11, 2007 You'll have to share some more info, like how does your script "know" what language it's supposed to output and how it is being done. I am assuming that this part you did do, but correct me if I am wrong. Orio. Quote Link to comment https://forums.phpfreaks.com/topic/72749-solved-help-on-this-problem-please/#findComment-366938 Share on other sites More sharing options...
~n[EO]n~ Posted October 11, 2007 Author Share Posted October 11, 2007 Ok... I forgot to post the 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 ="./dutch/".$pageName."?".$QueryString; if($langFlag==false){ if($QueryString!=""){ $pageFrURL .="&"; $pageEnURL .="&"; $pageRuURL .="&"; } } ?> and used like this in link... <a href="<?=$pageEnURL?>"><img src="images/flag3.jpg" alt="" width="29" height="14" border="0"/></a> this code i downloaded from one site.... Can you please explain how this works ? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/72749-solved-help-on-this-problem-please/#findComment-366944 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.