regoch Posted June 6, 2011 Share Posted June 6, 2011 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. Quote Link to comment Share on other sites More sharing options...
regoch Posted June 6, 2011 Author Share Posted June 6, 2011 <?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. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted June 6, 2011 Share Posted June 6, 2011 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 Quote Link to comment Share on other sites More sharing options...
regoch Posted June 6, 2011 Author Share Posted June 6, 2011 session_start(); $_SESSION['lang'] = '$home_jezik'; require_once('kontakt-obrada_'.$_SESSION['lang'].'.php'); This way works for every language, not just for english! Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.