Jump to content

Language switch


regoch

Recommended Posts

Hi!

I have problem with switch language code.

<?=$home_jezik?>

Its my variable for active language. But i won't to add it in php script to call difrent php for every language.

<?php include("include/jezici.php"); 	
//Start session
session_start();

//Podaci za spajanje na bazu podataka
require_once('kontakt-obrada-???.php'); 
$_SESSION['myForm'] = $_POST;
?>

I wonnA add language variable where is "???". Try some different ways but always getting error.

Link to comment
Share on other sites

<?php include("include/jezici.php"); 	
//Start session
session_start();

//Podaci za spajanje na bazu podataka
require_once('kontakt-obrada".$home_jezik.".php'); 
$_SESSION['myForm'] = $_POST;
?>

I ttry something like this but nothing.

Link to comment
Share on other sites

assuming you select the language once for each session, you can use a $_SESSION variable to hold it:

session_start();
$_SESSION['lang'] = 'en';
require_once('kontakt-obrada_'.$_SESSION['lang'].'.php');

will load: kontakt-obrada_en.php;

 

hope this helps

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.