I have a site that is translated in 3 languages. English, Korean and Chinese. The users can click on what language they want to view the site on the splash page. The problem I've been running into is if they do not enter through the splash page or type in the exact URL for the homepage including the specific language they get a page with no text. Is there a way that I can make the site default to english if the user enters my site through a backpage? The programmer who did my site has this snippet of coding on most of the pages.
PHP Code:
<?php session_start(); if($_SESSION['lang']=='english'){ include_once "english.php"; } else if($_SESSION['lang']=='chinese'){ include_once "chinese.php"; } else if($_SESSION['lang']=='korean'){ include_once "korean.php"; } $_SESSION['getwill_id']=""; ?>
This code is found on the homepage.
PHP Code:
<?php session_start(); $lang=trim($_GET['lang']); if($lang=='e'){ $_SESSION['lang']="english"; } else if($lang=='c'){ $_SESSION['lang']="chinese"; } else if($lang=='k'){ $_SESSION['lang']="korean"; }
if($_SESSION['lang']=='english'){ include_once "english.php"; } else if($_SESSION['lang']=='chinese'){ include_once "chinese.php"; } else if($_SESSION['lang']=='korean'){ include_once "korean.php"; }
?>
Last edited by tizpsyko; 07-12-2008 at 01:30 PM..
|