FIREBALL5 Posted June 20, 2008 Share Posted June 20, 2008 I'm trying to make a mechanism that saves information through repeated refreshes, but it's not adding on relatively; it's overwriting. Even using sessions. Here is some code: session_start(); $_SESSION["id"] = $_GET['q']; $_SESSION["answerQ"] = $_POST['answer']; $_SESSION["myanswer"][$_SESSION["id"]-1] = $_SESSION["answerQ"]; This code is called every time the page refreshes. However, $_SESSION["myanswer"][$_SESSION["id"] -1] keeps getting reset. $_SESSION["id"] is getting incremented by 1 every refresh. .. Thanks ..? -FIREBALL5 Link to comment https://forums.phpfreaks.com/topic/111036-sessions/ Share on other sites More sharing options...
sherbetlemon Posted June 20, 2008 Share Posted June 20, 2008 I think it will really overwrite your variable.. since you are using the same id everytime you refresh the page... try to analyze your code... Link to comment https://forums.phpfreaks.com/topic/111036-sessions/#findComment-569799 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.