1 Reply Latest reply on Oct 3, 2007 2:15 AM by Newsgroup_User

    Sessions in PHP (prechecking check boxes)

    Sw Jiten Level 1
      Hello everyone. Please... here is my situation:

      I have a simple HTML / PHP page where the user can select some checkboxes ... then these values are stored on memory through $_session function... everything works allright... however, I need that, if customer comes back to this page, he can find all the checkboxes he selected before already selected (I mean, not only to hvae those values, but also to have visually marked). Everytime I go back to that page, my values aare perfectly stored on memory (I see them with echo function) but they are not displayed on checkboxes, because checkboxes are empty...

      How do I achieve this please ? Thanks in advance...
        • 1. Re: Sessions in PHP (prechecking check boxes)
          Level 7
          On 03 Oct 2007 in macromedia.dreamweaver, Sw Jiten wrote:

          > Hello everyone. Please... here is my situation:
          >
          > I have a simple HTML / PHP page where the user can select some
          > checkboxes ...
          > then these values are stored on memory through $_session function...
          > everything works allright... however, I need that, if customer comes
          > back to this page, he can find all the checkboxes he selected before
          > already selected (I mean, not only to hvae those values, but also to
          > have visually marked). Everytime I go back to that page, my values
          > aare perfectly stored on memory (I see them with echo function) but
          > they are not displayed on checkboxes, because checkboxes are
          > empty...
          >
          > How do I achieve this please ? Thanks in advance...

          Done on the fly so there may be a more efficient way to do this:

          <input name="ffff" type="checkbox" id="ffff" <?php echo isset($_SESSION['ffff']?' checked="checked"':''; ?>/>

          --
          Joe Makowiec
          http://makowiec.net/
          Email: http://makowiec.net/contact.php