Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

bilingual site, url link redirecting to proper directory

Links for php scripts

Moderators: macek, egami, gesf

bilingual site, url link redirecting to proper directory

Postby micka8 » Wed Apr 09, 2003 1:05 pm

Howdy!

Would someone know how I may allow a link to be clicked on so that a web visitor could either choose to display the page in English or French ?? (switching directories from adael.net/en/page1.htm to adael.net/fr/page1.html) ??

actually, the root directory read the French pages and the /en reads the English pages.

Hope I ll get a quick answer )
Thanks!
Mickael
micka8
New php-forum User
New php-forum User
 
Posts: 5
Joined: Sat Apr 05, 2003 2:44 am
Location: Paris

Postby mammal » Thu Apr 10, 2003 12:21 am

You could set a cookie once they've chosen their preference
such as:

<?

// $HTTP_GET_VARS[$language] = "en" or ""

session_start();

## Register the input with the value

if ($HTTP_GET_VARS[$language] && !$HTTP_SESSION_VARS[Language]) {

$Language = $HTTP_GET_VARS[$language];

## Create new Session Values
session_register('Language');

} else {

$Language = "en/";

}

?>

Then make sure links have this:

<a href="adael.net/<?=$Language ?>page1.htm">click here</a>

Hopefully this makes sense...
User avatar
mammal
New php-forum User
New php-forum User
 
Posts: 37
Joined: Wed Apr 02, 2003 1:31 am
Location: Hythe, UK

Postby micka8 » Fri Apr 11, 2003 5:00 am

Thanks and hello Mammal! :)

If I tackle the problem like this it means I actually have to hard code in each page! the corrsponding link which actually eliminates the benefit of the script??

To get a god undestanding of the issue you can peak at: adael.net

Thanks!
Mickael
micka8
New php-forum User
New php-forum User
 
Posts: 5
Joined: Sat Apr 05, 2003 2:44 am
Location: Paris


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.