I know how to apply the multilingual in php and i've got a problem with url.
When i click the tag and switch the language i send one parameter right? but the point is I need one more parameter to load the page.
uhm it's kinda hard to explain.
<a href="userInfo.html?user_code=1">user1</a>
)<a href="?lang=en">english</a>
to switch the language on 'userInfo.html' page.how can i do it?
//top.php side menu
<ul id="menu1" class="dropdown-menu list-unstyled msg_list animated fadeInDown" role="menu">
<li>
<a href="?lang=ko&arg1=<?= $ARG_1; ?>">Korean</a>
</li>
<li>
<a href="?lang=en&arg1=<?= $ARG_1; ?>">English</a>
</li>
</ul>
\
//user list page to click the user
$user = "<tr class='even pointer'>"
. "<td class=''><a href=\"/userInfo.html?user_code=".$row["code"]."\">"
.$row["name"]."</a></td>"
. "<td class=''>".$row["age"]."</td>"
. "<td class=''>".getDataValue($USER_CATEGORY, $row["vip"])."</td>"
. "<td class=''>".getDataValue($USER_REPU, $row["reputation"])."</td>"
. "<td class=''>".getDataValue($USER_EMAIL, $row["email"])."</td>"
. "<td class=''>".getDataValue($USER_GENDER, $row["gender"])."</td>"
. "<tr>";
You can use this function, for generating language changer urls
function getLangUrl($lang){
$newurl="";
$url = $_SERVER['REQUEST_URI'];
$url=parse_url($url);
var_dump($url);
if(isset($url["host"]))$newurl=$url["host"];
if(isset($url["path"]))$newurl.=$url["path"];
$newurl.="?lang=".$lang;
if(isset($url["query"])&&!empty($url["query"]))$newurl=$newurl."&".$url["query"];
return $newurl;
}
//generating url for english language
echo getLangUrl("en");