Multi language - seo links
Posted on
16th Feb 2014 07:03 pm by
admin
Im trying to figure out the best method to have a multi language website that will function with seo friendly links.
The code that ive used many times before.....
Did you know?Explore Trending and Topic pages for more stories like this.
Code: $_SESSION['lang'] = $lang = (isset($_GET['lang']) ?
mysql_real_escape_string(trim($_GET['lang'])) : (isset($_SESSION['lang']) ? $_SESSION['lang'] : 'en')); if (!function_exists("GetSQLValueString"))
which i like as it refreshes the page that the viewer is on and pulls down info form the db with the correct extension i.e. about_en, about_it, about_de etc etc
The problem is when the user changes the language using with the follwing...
Code: if ($_SERVER['QUERY_STRING'])
{
echo "<a href="?{$_SERVER['QUERY_STRING']}&lang=en">EN</a>";
}
else
{
echo "<a href="?lang=en">EN</a>";
}
?></li>
<li><?php if ($_SERVER['QUERY_STRING'])
{
echo "<a href="?{$_SERVER['QUERY_STRING']}&lang=it">IT</a>";
}
else
{
echo "<a href="?lang=it">IT</a>";
}
?></li>
<li><?php if ($_SERVER['QUERY_STRING'])
{
echo "<a href="?{$_SERVER['QUERY_STRING']}&lang=fr">FR</a>";
}
else
{
echo "<a href="?lang=fr">FR</a>";
the page refreshes but with '?lang=it' at the end of the address, therefore im 'presuming' the mod_rewrite will fail...
any ideas of what would be the best solution..
many thanks
No comments posted yet
Your Answer:
Login to answer
182
54
Other forums
Implementing Single Sign-On using SAML 1.1, x.509, LDAP in C#.net
Hi,
I got a requirement from the client i.e implementing single sing on using SAML 1.1( LDAP &
Something Non-Traditional. Can we solve?
I have an idea for an application here. It's mostly flash, but it couldn't work without a somewhat n
Query output more than expected
$query=mysql_query("SELECT * FROM players, communities, divisions WHERE dob BETWEEN '{$start_da
Select Lists into MYSQL
Hello All, I am new to PHP @ 1 week. So borrowing code anywhere I can. I am making progress, but h
pop3 and fsockopen
So I am able to connect to the pop3 server, log in, and check how many messages there are. I am hav
mysql select query problem
how can i select multiple fields from multiple table in one query like
i have table name t1 a
writing my own sobel filter convolution - something is wrong
I am trying to keep it very simple, I cant see anything wrong with my logic, could anybody help poin
php mysql query from input textbox
Hi,
I have a text box, in that i have given the mysql query. I can able to get the query in v
Query issues
I probably have this setup wrong well I know I do because nothing is showing up now. What I want is
how to query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass