sessions newbie question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


Attempting to collect items from  various pages (like a shopping cart, or
wish list).

Page with items:

<form method="POST" action="litRequest.php">
<input type="hidden" name="request_model" value="8940">
<input type="hidden" name="description" value="Single Service-Lighted">
<input type="submit" value="8940" name="button">


litRequest.php results page:



if ($description){
   if (!isset($informationitems)){
      foreach($informationitems as $k => $v){
         if ($description==$k){
      if (!$count) $informationitems[$description]=$model;


if (isset($informationitems)){
   echo 'your items:<br>';
   foreach($informationitems as $k => $v){
      echo 'description: '.$k.' model number: '.$v.'<br>';

It only displays last item selected, not multi items selected.
 Thanks in advance!!

Re: sessions newbie question

Quoted text here. Click to load it

 Just picking on this bit that jumped out - session_register is deprecated and
shouldn't be mixed with usage of $_SESSION (which is the modern way to access
and modify sessions).

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. "

< Space: disk usage analysis tool

Site Timeline