php - how to keep multi session live together -


Thank you very much and sorry to bother. I'm still stuck a PHP, trying to understand me There are some problems / working with knowing how to maintain multi session .. Here are my existing sessions eg

  session_start (); // If no session is present, create one if (! Session_is_registered ('lesson')) {$ _SESSION ['lesson'] = new lesson; } $ Lesson = $ _SESSION ['Lessons'];  

And then I want to add a new session from the code below:

  if (! Isset ($ _ POST ['languageselect'])) { $ Languageselect = $ standard language; } Other {/ * set standard language * / $ languageselect = $ _POST ['shylgiaject']; } // Andif if ($ languageselect == 1) {/ * my language pack * / $ languagearray = array (1 = & gt; "one", 2 => "two"); } Other {/ * English Language Pack (= Standard) * / $ languagearray = array (1 = & gt; "one", 2 = & gt; "two"); Function printoptionbox ($ boxname, $ cssclass, $ elementary, $ kataktiv = 1) {echo "& lt; name =" $ boxname "class = '$ cssclass' & gt;"; While (list ($ key, $ value) = each ($ elementsarray) {if ($ key == $ kataktiv) {$ SELECTED = "SELECTED"; } And {$ SELECTED = ""; } // Andif echo "option $ selected value = '$ key' & gt; $ value & lt; / option & gt;";  

Here's the HTML code from the dropdown language options:

  Code> & lt; td class = "arial" width = "210" & gt; & lt ;? php printpixibox ("lilagicact", "liljject", $ language_array, $ katak = $ shalejackage);? & Gt; & lt ; / TD & gt; & lt; input type = "submit" name = "languageselectsubmit" value = "right" width = "30" style = "width: 30px; Font Size: 10px "class =" submitbutton ">  

But in the most confused, how do I create sessions from the above language code and then for another page (different code) This will be done because multiple language options work only on the first page but reset it to the next page ...

Thank you very much for any advice here Your intention was not fully followed, but I mention this I want to 1) You will not be able to maintain two sessions at the same time and 2) I do not think you will actually need any kind.

Array can store data if you are sure that you want to store that data in session, just add your array and drag it back when necessary. What do you need to do is code your code So that if they choose a different language then overwriting the old array is swap the new language.

You can find it easily (as I did recently) on the server To store your language arrays in serialized flattening files, and then exclude them based on users' preferences. It's very low on the overhead, very fast, and you can get the ability to 'cache' your language so that no processing is needed.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -