Posted By

nveselinov on 11/11/10


Tagged

php language site multi


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

vehler
dubogii


Multilanguage site with php


 / Published in: PHP
 

  1. <!-- Included files contain, variable with their values -->
  2. <!-- Example url: index.php?lang=en -->
  3. <?php
  4. if (!isset ($_GET['lang'])) {
  5. if(isset($_SESSION['lang'])){
  6. $lang=$_SESSION['lang'];
  7. }
  8. else {
  9. $lang='bg';
  10. }
  11. } else {
  12. $lang = $_GET['lang'];
  13. }
  14. if ($lang=='bg') {
  15. $_SESSION['lang'] = 'bg';
  16. require('bg.php');
  17. } else {
  18. $_SESSION['lang'] = 'en';
  19. require('en.php');
  20. }
  21. $_SESSION['lang']=$lang;
  22.  
  23. echo "$home";
  24. ?>

Report this snippet  

You need to login to post a comment.