Forum Moderators: coopster
I have a form with 12 questions and 12 buttons, when the user hits the button i want the question id of the question to be appended onto a cookie, so when the user is done the cookie will look like this, 897, 786, 678, 789.
basically i want to know how to append onto a cookie, i only know how to set a cookie.
this is what i have so far,
if (isset($_POST['addThis']))
{
$questionList = $_POST["addThis"];
echo $questionList;
setcookie("questionList", $questionList);
echo $_COOKIE["questionList"];
}
and the form is like this,
<table border="0" cellspacing="10" >
<tr><td>three</td><td><form action='quesLibrary.php' method='post'><input name='addThis' type='hidden' value='825'><input name='add1' alt='add this question' value='Add Question' type='submit'></form></td></tr><tr><td>four</td><td><form action='quesLibrary.php' method='post'><input name='addThis' type='hidden' value='826'><input name='add1' alt='add this question' value='Add Question' type='submit'></form></td></tr><tr><td>One</td><td><form action='quesLibrary.php' method='post'><input name='addThis' type='hidden' value='827'><input name='add1' alt='add this question' value='Add Question' type='submit'></form></td></tr>
</table>
any help would be appreciated,
thanks