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.....
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
Add_Months not Easy to Understand
Oracle is number 1, very fast and very easy. But....
(sub)screen resize modification doesn't work after ECC 6 EhP 4 installation
Hello,
modifying query string with no page refresh
Hi everybody,I've tried to get info about my problem all over the internet but i didn't find out what I need.The question is: how can I modify the querystring in PHP with no page refresh?Facebook uses
double and single quotes in text fields acting up... help please
Single quotes, when entered into a text field, create an sql error upon Submit. It seems to create the query OK but says there's an SQL syntax error and stalls out on that field.Also any time a
Problems with strings containing
Hey all,I have encountered something strange in a script. I am trying to write an XML header and then fill in the file:Code: $xmlFile = "fetchableData.xml";$fh = fopen($xmlFile,
extract content from a website
i have written a code that will grab the content from the index page..i would like to know how can i leech completely thru the site (index,contact, news pages) and grab specific content only like
How to sum these output values
Hi
Form errors in an array
I'm processing a form and putting the errors in an array. empty($errors) doesn't seem to do the trick when trying to check to see if the array is empty. Is my understanding of empty()incorrect? Each
If a record matches an existing record do nothing
So I don't know if I should put this here or in mysql, but what my script is for is for people to add their emails to our mailing list. Pretty simple, I got that working. But what I want it do now
Help With Showing Users On the Index Page
Ive got this code which works just how i want it to.Code: <? $timenow=time();$select = mysql_query("SELECT * FROM users WHERE online > '$timenow' ORDER by id ASC");$num =