kenneal Posted December 22, 2008 Share Posted December 22, 2008 I have some problems with my sessions. Apparently only some of the sessions are passing over. I am not sure why. question.php $i=0; while ($i < $num) { $f0=mysql_result($result,$i,"qid"); $_SESSION['qid' . $i]=$f0; $i++; } //Set starting score and last question. $_SESSION['score']=0; $_SESSION['last']=10; question2.php $i=0; while ($i < $num) { echo $_SESSION['qid' . $i]; $i++; } //Echo echo $_SESSION['score']; echo $_SESSION['last']; I have tested question.php and it sets all the sessions there alright. Tried echoing it and it works. However in question2.php, only the score and last session values posts. Does anyone have any idea? These files are all in the same main domain and folder too. Rgds, Kenneth Link to comment https://forums.phpfreaks.com/topic/137982-problem-with-session-ids/ Share on other sites More sharing options...
Lamez Posted December 22, 2008 Share Posted December 22, 2008 1. Use the code tags please! 2. When in doubt, echo out! Echo out, $i Link to comment https://forums.phpfreaks.com/topic/137982-problem-with-session-ids/#findComment-721164 Share on other sites More sharing options...
Lamez Posted December 22, 2008 Share Posted December 22, 2008 also, where is $num defined at? Link to comment https://forums.phpfreaks.com/topic/137982-problem-with-session-ids/#findComment-721172 Share on other sites More sharing options...
kenneal Posted December 22, 2008 Author Share Posted December 22, 2008 $num is the number of rows as returned by mysql. I got it! I forgot to define $num in question2.php. Little wonder then. Thanks Link to comment https://forums.phpfreaks.com/topic/137982-problem-with-session-ids/#findComment-721174 Share on other sites More sharing options...
Lamez Posted December 22, 2008 Share Posted December 22, 2008 lol, I do it all the time! Link to comment https://forums.phpfreaks.com/topic/137982-problem-with-session-ids/#findComment-721177 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.