You are here: stange behavior of $_SESSION « PHP Language « IT news, forums, messages
stange behavior of $_SESSION

Posted by Peter Pei on 01/07/08 02:15

With a usual (well bothing should be unusual) array,
$a[] = "a"; $a[] ="b" sets the first two elements of the array.

I expect somthing like this to work in exactly the same way:
start_session();
$_SESSION[] = $_POST["a"];
$_SESSION[] = $_POST["b"];

So what I meant is that run this page, PHP should set the first 4 elements,
but what actually happened was the second round overwrites the first one,
and the array ends up only have the first 2 elements set.

 

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

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