Jump to content

Cookie disappearing after moving to another form


Tyler7028

Recommended Posts

//declaring variables
$answerOne = $_POST['answer1'];
$answerTwo = $_POST['answer2'];
$answerThree = $_POST['answer3'];
$answerFour = $_POST['answer4'];
$answerFive = $_POST['answer5'];
$answerSix = $_POST['answer6'];
//declaring my cookies
$exp = time()+86400;
setcookie("answer1text", $answerOne, $exp);
setcookie("answer2text", $answerTwo, $exp);
setcookie("answer3text", $answerThree, $exp);
setcookie("answer4text", $answerFour, $exp);
setcookie("answer5text", $answerFive, $exp);
setcookie("answer6text", $answerSix, $exp);
 
I have 6 different questions coming from a text document. I am trying to display the cookies, but they keep disappearing once I move through the different forums.
Does anyone know why they keep disappearing I am using the developer tools and they are going through but only stay on one page.
<tr>
<td><?php echo $contents[0]; ?></td><td>The sub-marine</td><td><?php echo $answerOne; ?>
</tr>
they look like such. 6 of these. I will upload the files as well. 

 

questions.txt

trivia.php

Link to comment
Share on other sites

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.