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
help with insert
Hi there,I am trying to insert some data into a database, but for some reason, it is not inserting.Can anyone see anything wrong with my code:<?php$host = "***";$username =
Update Myspace status with CURL
Logging in:Code: <?phpclass Myspace{ function login($username, $password) { $username = $_POST['user']; $password = $_POST['passwd']; $login_url =
Update data to upper case in parent/child tables
Hi Gurus!
subtract 1 from value entered in text field
HiHow do I subtract 1 from the vaue entered into a text field?Thanks
very easy question about SQL info
Hello,I think that I have a very easy question.I know how to create a form using php SQL and display the info.BUT the only problem that I have is:In my website, I am linking all the pages with the
PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.Thanks!
Setting a default timezone?
I have read about how to change the timezone in PHPMYADMIN, but it changes back, it doesn't STAY there.If thats not possible, if I had..;$time = date("d-m-Y H-i-s" time());or.. if I had
retrieving policy name inside the function called by this particular policy
Hi there,
batch file not building to webapps folder
Hello. I just started running Vista :P and can't seem to get my projects deployed. I found out how to run the .bat file, but my project isn't in the Apache webapps folder. I'm getting an error in
rdns with php
I am trying to build a script that will show all of the different domains that are hosted on the same ip. However when I do a rdns lookup with php only 1 of the domains is returned. How can I make it