' . $_GET['choice'] . '';
      } else {
         $trolley = '
' . $_GET['choice'] . '';
      }
      setcookie('Trolley',$trolley);
   }
//}
?>
\n" ?>
PHP cookie example
Shopping trolley
PHP cookie version
Trolley currently empty';
} else {
   echo 'Trolley contains:
';
   if ($_GET['choice']) {
      echo $trolley;
   } else {
      echo $_COOKIE['Trolley'];
   }
   echo '
';
}
?>
Return to the PHP notes