[PHP] Help!session problem!

2003-12-06 Thread
 Hello:
  I want your help! And i am pool in english! 
  The session sometime works well,sometime works badly!
 It creates new empty file in /tmp.I also find this problem
 with apache1.3.12php4.1.1sybase11.9.2linux
 My php.ini is fault
 my server config:
php4.3.3
httpd2.0.44
linux 9
sybase-11.9.2
 tar-vzxf php-4.3.3.tar.gz
 ../configure ?with-apxs2=/home/apache/bin/apxs
 ?with-sybase-ct=/opt/Sybase-11.9.2 ?enable-ftp ?enable-track-vars
 ?disable-cli
 make
 make install
 cp php.ini-dist /usr/local/lib/php.ini
 

  Thanks a lot
 
 Reproduce code:
 ---
 login.php:
 $user_array=sybase_fetch_row($result);
session_start(); 
session_register(user_array);
 ...
 index.php:
 session_start();
 $user_name=$user_array[1];


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [PHP] Help!session problem!

2003-12-06 Thread Chris Shiflett
--- ÎÚÓÐ ÎÞ [EMAIL PROTECTED] wrote:
  Reproduce code:
  ---
  login.php:
  $user_array=sybase_fetch_row($result);
   session_start(); 
   session_register(user_array);
  ...
  index.php:
  session_start();
  $user_name=$user_array[1];

Try this instead:

login.php:
session_start();
$_SESSION['user_array'] = sybase_fetch_row($result);
...

index.php:
session_start();
$user_name = $_SESSION['user_array']['1'];
...

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
 Coming mid-2004
HTTP Developer's Handbook
 http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php