people i stuck with one problem connected with session write

somewhere in script i try to write posted (textarea) var into session

$fcomment = $_POST['fcomment'];

$_SESSION['fcomment']['ftext'] = $fcomment;

after this i type print_r($_SESSION);
part of printed session looks like =
....... . . .. .. . . {s:5:"ftext";N;}

why N;

some days before i have not problems with it, but now i stuck,
why i cant write var into $_SESSION['fcomment']['ftext']

thank u for help

    Have you tried serialize and unserialize functions.

      how serialize and unserialize functions can help me in my situation ?

      all variables which are writed into active session trought $_SESSION are automatically serialized by php standart serialize function i dont use wddx or another serialization functions

      i have two pages

      first page content is

      <form name=...... method="post" ........

      <textarea name='fcomment'></textare>

      submit value='post comment'>
      </form>

      =============================

      all content of first form is posted into second php file

      all this three php files work with my php lib in which session_start is always first

      second form content is

      $sssss = $_POST['fcomment'];

      var "fcomment" is not empty and is of normal content
      but when i try to make this
      $_SESSION['fcomment']['ftext'] = $sssss ;

      i can see in session file only ......... ftext";N;

      why N;

      after this in third php file i try to call this value with
      echo/or print/or print_r $_SESSION['fcomment']['ftext']

      and result = "";

      result is empty ,,,,

      some days ago i had not any problems with writing variables into session like associative arrays, but now i realy stuck with this problem i cant find out, where is the problem

      thank u for help

        When I saw this {s:5:"ftext";N;} I can say that its serialized so
        I thought you need to unserialize it.

        any wany I have the same setuation as yours
        You have to setup the array in the first page with null value
        even if you are not going to use it in that page it has to be their

        $_SESSION['thename'][$countDay][$count] = "";

        any way I have a very complicated code you might not need to do
        that on your code but try to assign it at the begining.

        sorry for the lack of information.

          now i try to describe my solution which i cant normally understand...

          your solution $_SESSION['thename'][$countDay][$count] = "";
          for me was wihtout result but thank you for helping.

          for example my web page form x number of php pages and one php file (library)

          for example when i try to post values in first php file into another document i do this....

          =vars to post begin=====================

          <form name="bla bla la" method="p">

          <input t = text ......... name="var1"
          <input t = text ......... name="var2"

          submit value="post this two vars to another document"
          </form>

          =vars to post end=====================
          this two vars i post to the document doc2.php (for example)

          =doc2.php in action begin=====================

          //begin of piece of code from library php file

          if (sizeof($POST)>0)
          {
          while (list($key,$value)=each($
          POST))
          {
          ${$key}=$value;
          }
          }

          this piece of code at this situation must create two vars
          var1 and var2

          //end of piece of code from library php file

          and now if i try to write var1 into session by this way (see below ), i get no result
          $_SESSION['fcomment']['place for var 1'] = $var1;

          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
          but if i write var1 into session by this way !, i get normal result

          if (isset($var1))$_SESSION['fcomment']['place for var 1'] = $var1;

          =doc2.php in action end=====================

          i know that i am not good in php, but reading some php articles i cant find answer to this situation ...

          maybe my problem was in this ....

          info from php.net>
          If a variable has been unset with unset(), it will no longer be set. isset() will return FALSE if testing a variable that has been set to NULL. Also note that a NULL byte ("\0") is not equivalent to the PHP NULL constant.

          can somebody more detaily explain to me what i did wrong....

          thank you people.....

            Write a Reply...