Jump to content

[SOLVED] Help on this problem please...


~n[EO]n~

Recommended Posts

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 ???

Link to comment
https://forums.phpfreaks.com/topic/72749-solved-help-on-this-problem-please/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.