[PHP] [Q] session variables wouldn't keep contents.

2001-03-12 Thread Chung Ha-Nyung


 Hi guys,

 Some php programs doesn't seem to work normally in a certain
 server. Those wokred correctly in my Debian box.
 Session is the problem.

 It seems that the contents of session variables disappears after
 reloading the php page. Here is the program.

  test.php 


";
session_register("name");
$HTTP_SESSION_VARS["name"] = "test";
echo "newly registered";
}
$session_name = $HTTP_SESSION_VARS["name"];
echo session_encode()."";
echo "session_name = $session_name";
?>


  test.php 

 Can I handle it with only php configuration file? Or Do I have to
 modify my php programs?

 In addition to this, I have a few questions about the work of session
 in php 4.0.4

 Q1) Do I have to use session_start() explicitly although session.auto_start
is set to 1 in php.ini?
 Q2) Do I have to use session_register("variable_name")?
 In my Debian woody box, it seems to run well without it.

 Regards,

-- 
 Chung Ha-Nyung <[EMAIL PROTECTED]>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] [Q] session variables wouldn't keep contents.

2001-03-13 Thread Chung Ha-Nyung

>>>>> "YO" == Yasuo Ohgaki <[EMAIL PROTECTED]> writes:

YO> - Original Message -
YO> From: "Chung Ha-Nyung" <[EMAIL PROTECTED]>
YO> To: <[EMAIL PROTECTED]>
YO> Sent: Tuesday, March 13, 2001 3:19 PM
YO> Subject: [PHP] [Q] session variables wouldn't keep contents.
> 
>   Hi guys,
> 
>   Some php programs doesn't seem to work normally in a certain
>   server. Those wokred correctly in my Debian box.
>   Session is the problem.

YO> The code seems wrong. Although, it can work. It depends on php.ini.

> 
>   It seems that the contents of session variables disappears after
>   reloading the php page. Here is the program.
> 
>    test.php 
> 
> 
>session_start();

YO> You must start session before output anything to browser, or you must use
YO> buffering to do this,
YO> or you must use URL mode for session.
YO> i.e. This code sends "" before starting session and cookie header
YO> must be sent before if session is cookie mode.

YO> I recommend to write session_start() before programmers do anything.

 I modified that way. But no effect. still not work correctly.
 After reloading, session variables are emptied. ;(

>  if(!session_is_registered("name")) {
> ";
>  session_register("name");
>  $HTTP_SESSION_VARS["name"] = "test";
> ";
> 
>  $session_name = $HTTP_SESSION_VARS["name"];
> ";
>  echo "session_name = $session_name";
> 
> 
> 
>    test.php 
> 
>   Can I handle it with only php configuration file? Or Do I have to
>   modify my php programs?

YO> I'm not sure what do you want to handle "it".
 
 Just *poor* english. ;P
 solving the above trouble.

YO> Starting session can handle in php.ini and inside code.

> 
>   In addition to this, I have a few questions about the work of session
>   in php 4.0.4
> 
>   Q1) Do I have to use session_start() explicitly although session.auto_start
>  is set to 1 in php.ini?

YO> No.

YO> Session will be started automatically, so programmer does not have to write it.
YO> I recommend to write session_start(), though.

YO> Also, session will be started implicitly if programmer uses session functions
YO> even without setting session.auto_start to true. It should work, if programmer
YO> didn't send any output to browser before. i.e. Programmer does not even have to
YO> write session_start() even if session.auto_start is false. I don't recommend 
it,
YO> though.

>   Q2) Do I have to use session_register("variable_name")?
    >   In my Debian woody box, it seems to run well without it.

YO> It seems works fine on my box without it when I use $HTTP_SESSION_VARS at 
least.
YO> I think it will not work without $HTTP_SESSION_VARS.
YO> (PHP4.0.4pl1/Apache/RedHat Linux7)

 I use only $HTTP_SESSION_VARS. ;)

YO> Regards,
YO> --
YO> Yasuo Ohgaki

-- 
 Chung Ha-Nyung <[EMAIL PROTECTED]>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] [Q] session variables wouldn't keep contents.

2001-03-13 Thread Chung Ha-Nyung


 My second example program.
 a.php 

 a.php 
 result is as following.

!name|


 and, /tmp/sess_7d755f490ba4e50da20d7167e2966771 file has only
 "!name|" without any stuff relating to "test" which I inserted
 into $HTTP_SESSION_VARS["name"]

 I can't figure out why this odd things happen.
 apache and php's configuration files are the same as thoes in
 my home computer and both of two computer use Debian/woody.

 Anybody has some clues about it? why session variables' contents
 wouldn't stored.

 Regard,
-- 
 Chung Ha-Nyung <[EMAIL PROTECTED]>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] [Q] session variables wouldn't keep contents.

2001-03-13 Thread Chung Ha-Nyung

>>>>> "YO" == Yasuo Ohgaki <[EMAIL PROTECTED]> writes:

>   As I posted right before, file is created in /tmp.
>   Franlking speaking, I did not make any change to default settings of php.ini
>   In other words,
>  session.save_handler = files
>  session.save_path= /tmp

YO> Then , as I wrote previous mail, you should at least have session data files
YO> there. (I forgot the exact name. I think it contains session id) Do you see any
YO> session data files? Is your session id changing everytime? or you don't have
YO> session id at all?  Do you see session module info in your phpinfo? Is it
YO> correct? Do you use E_ALL for error reporting? (You may see some errors like
YO> oops header already sent)

  Certainly are there data files which look like "sess_sessionid" in /tmp and
  changed everytime when I reload the web page. And sessoinid is the same as
  the value of cookie variable, PHPSESSID. Up to this stage does things seem
  to go well. I think so.

  phpinfo result looks correct...almost.
  *THERE'S NO HTTP_SESSION_VARS* in PHP variables!! although I used session_start()
  and session_register()! It is incorrect, isn't it?

  I can see session module info in my phpinfo and it is correct. ;(
  Surely I set
error_reporting = E_ALL
display_errors = On
display_startup_errors = On

  and no error/warning messages in the page. 

YO> Something must be wrong, since your environment is similar to that I have.

  I found something!
  If I set register_globals to Off in php.ini, then session *seems* to work well.
  In /tmp, session data file contains both of variable name and value and I can
  use $HTTP_SESSION_VARS["variable"].
  BUT, as before is there no HTTP_SESSION_VARS in PHP variables section of phpinfo.

  I'm so confused and think things are getting weirder. ;(

YO> Regards,

YO> Yasuo Ohgaki

YO> -- 
YO> PHP General Mailing List (http://www.php.net/)
YO> To unsubscribe, e-mail: [EMAIL PROTECTED]
YO> For additional commands, e-mail: [EMAIL PROTECTED]
YO> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
 Chung Ha-Nyung <[EMAIL PROTECTED]>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] [Q] session variables wouldn't keep contents.

2001-03-14 Thread Chung Ha-Nyung

>>>>> "YO" == Yasuo Ohgaki <[EMAIL PROTECTED]> writes:

YO> - Original Message -
YO> From: "Chung Ha-Nyung" <[EMAIL PROTECTED]>
YO> To: "Yasuo Ohgaki" <[EMAIL PROTECTED]>
YO> Cc: <[EMAIL PROTECTED]>
YO> Sent: Wednesday, March 14, 2001 5:07 PM
YO> Subject: Re: [PHP] [Q] session variables wouldn't keep contents.

> 
>I found something!
>If I set register_globals to Off in php.ini, then session *seems* to work
YO> well.
>In /tmp, session data file contains both of variable name and value and I
YO> can
>use $HTTP_SESSION_VARS["variable"].
>BUT, as before is there no HTTP_SESSION_VARS in PHP variables section of
YO> phpinfo.
> 
>I'm so confused and think things are getting weirder. ;(
> 

YO> I set "register_globals = Off" for many reasons.
YO> Session may not work with "register_globals = On"??
YO> It may be a bug. How about post it as a bug, if you don't like it and there is
YO> no such a bug report.

  Then, is it not odd that there's no HTTP_SESSION_VARS in PHP Variables
  section of phpinfo?
  
YO> Regards,

YO> --
YO> Yasuo Ohgaki

YO> -- 
YO> PHP General Mailing List (http://www.php.net/)
YO> To unsubscribe, e-mail: [EMAIL PROTECTED]
YO> For additional commands, e-mail: [EMAIL PROTECTED]
YO> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
 Chung Ha-Nyung <[EMAIL PROTECTED]>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] [Q] double quote(") is auto-transformed into (\")!

2001-03-19 Thread Chung Ha-Nyung


 I found that when I pass the double quote(") through get(or post) method,
 it is transformed into slash + double quote (\").
 Although it seems useful in making SQL query, it's really annoying whenever
 I pass the value to the other php page through get/post again.

 Can I turn off this feature?

-- 
 Chung Ha-Nyung <[EMAIL PROTECTED]>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]