Jump to content

Recommended Posts

Hi,

i completely lost on how i could establish the following

 

On page1.php i would like to have a couple of checkboxes

the checkbox values should initially be storred within a session variable (array)

when the checkbox status changes, these session variable should be updated.

 

i would like to avoid the "post" method.

 

many thanks for your advise!

 

rgds

Patrick

You cound use ajax and call the checkbox_set.php?check1=1&check2=0&check3=1... whenever there are any changes to the checkboxes. In checkbox_set.php you would analize the GET string and do something like:

 

if ($_GET['check1'] == 1 || $_GET['check1'] == 0)

$_SESSION['check1'] = $_GET['check1'];

 

In case I got ur question right, you wanted to use sessions and without post? This way you could modify $_SESSION variables.

Thanks for your reply

 

Im still lost on your approach actually.

 

let me try to be more clear.

 

on my page im trying to have one <div> tag with content generated from a database.

 

the content from the database is dependant on the status of the checkboxes. I.e. with the checkboxes you can filter on some database fields.

 

The checkboxes are contained by an other <div> tag.

 

Changing one checkbox, should update the output from the database right away to make it more interactive.

 

I'm now using ?check1=1&check2=0&check3=1.... to post the values nut Eventually, there will be lets say 50+ checkboxes so i would like to develop a clean and efficient solution.

 

my idea was to store the checkbox values in an session array.

 

thanks

 

Patrick

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.