You are here: Re: session change from 4.2.3 -> 4.3.x? « PHP Programming Language « IT news, forums, messages
Re: session change from 4.2.3 -> 4.3.x?

Posted by Alvaro G Vicario on 09/05/05 10:55

*** Name wrote/escribió (Fri, 02 Sep 2005 16:07:00 GMT):
> <?
> session_start();
> session_register("count");
> $count=$count+1;

You modify $count *after* storing it in session data?

> echo $count;
> ?>
[...]
> session.register_globals=1

> When I run this, count always displays as 1.

From manual:

"If you want your script to work regardless of register_globals, you need
to instead use the $_SESSION array as $_SESSION entries are automatically
registered. If your script uses session_register(), it will not work in
environments where the PHP directive register_globals is disabled."

I particularly find it very easy to write insecure scripts when
register_globals is set to 'on' so I always use $_SESSION. I don't think it
worth trying to debug a script that relies on register_globals.


--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация