can not store values in cookies

Discussion in 'PHP' started by goutam.dutta123, Oct 25, 2007.

  1. #1
    Hello experts,

    i want to store the values of my checkbox which are checked into cookies.But i can not do it.here is my code:

    function keepID(value)
    {
    i = 0;
    var ca = document.cookie.split(';');
    for(i=0;i<<?php echo $_SESSION['row'] ?>;i++)
    {
    if(document.myform.chkID.checked==true)
    {
    ca=value;

    }
    }

    }
    my checkboxes are moving in a loop:
    <input type="checkbox" name="chkID[]" id="chkID" value="<?=$rowSubjects['ID']?>" onClick="keepID(<?=$rowSubjects['ID']?>)">
    Please help...

     
    goutam.dutta123, Oct 25, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    Do you actually want to set the cookies with Javascript or PHP?
     
    nico_swd, Oct 25, 2007 IP
  3. goutam.dutta123

    goutam.dutta123 Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hello Sir:

    I want to set the cookies with javascript
     
    goutam.dutta123, Oct 25, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    nico_swd, Oct 25, 2007 IP