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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.