kvarnerexpress 0 Report post Posted May 2, 2005 I am rewriting a PHP install script. The first thing the user sees is an option to choose language. There are 3 languages Danish, English and German. I have 3 language files with variables with assinged values like this: PHP Code:$help="Help"; When you choose a language, say, English the page jumps to a file with this script:PHP Code:session_start(); header("Cache-control: private"); // IE 6 Fix. $name = $_POST['language']; $_SESSION['lang'] = $name; if($_SESSION['lang']=='dan'){ include "../instlang/install.language.danish.php"; } if($_SESSION['lang']=='eng'){ include "../instlang/install.language.english.php"; } if($_SESSION['lang']=='ger'){ include "../instlang/install.language.german.php"; } ?> When your choise of language has been determined, your supposed to go to the first install screen.Qustion:How do I via the session tell the first install screen what kind of language it should include and shoud I direct the user to the first install screen via a header?Thank you. Share this post Link to post Share on other sites
mobious 0 Report post Posted May 3, 2005 you should use the GET method. redirect it like this. first.install.screen.php?lang=en Share this post Link to post Share on other sites
webaurores 0 Report post Posted May 4, 2005 $name = $_POST['language'];you are using $_POST, so you have to either change $_POST into $_GET or use a form instead a link to choose the language.fo example, if you want to choose the lang with a form, you may write:<form action="first.install.screen.php" method="post" name="langForm"><p><input type="radio" name="language" value="dan" />Danish<br /><input type="radio" name="language" value="ger" />Germany<br /><input type="radio" name="language" value="eng" />English<br /></p></form> if i understood your question right, this sould work Share this post Link to post Share on other sites
mobious 0 Report post Posted May 9, 2005 looks like you just need to pick from to solutions. being able to pick a language through a form or link. Share this post Link to post Share on other sites
Spectre 0 Report post Posted May 24, 2005 Using the $_SESSION variable is fine and workable. Just note that you need to include session_start(); within each script that will access that session information before attempting to retrieve values from the array.So for example, in every other script that is used externally thereafter: session_start();$lang = $_SESSION['lang']; On another note, using the include() function is more or less the equivalent of taking the data from the specified file, and placing it in the script at hand; which means that if the file being called in the include() function is a PHP script, it will have access to all of the existing variables, including $_POST; so, for example, '/instlang/install.language.danish.php' would be able to retrieve $_POST['language'].I think that's sort of what you're asking. Share this post Link to post Share on other sites
beeseven 0 Report post Posted May 25, 2005 I agree that you could use $_GET. You could have a form that's like this: <form method="get" action="something.php"> //method="get" adds the values of the inputs to the url<input type="radio" name="lang" value="danish"> Dansk<input type="radio" name="lang" value="german"> Deutsch<input type="radio" name="lang" value="english"> English //3 radio buttons with the languages<input type="submit" name="submit" value="Read File"></form>Then in the PHP file:if($_GET['lang'] == "danish") { include 'danish.php';}elseif($_GET['lang'] == "german") { include 'german.php';}elseif($_GET['lang'] == "english") { include 'english.php';}If you have any links, you should just put this:<a href="somethingelse.php?lang=<?php echo $_GET['lang']; ?>"> Share this post Link to post Share on other sites