Link to home
Create AccountLog in
Avatar of mattibutt
mattibuttFlag for United States of America

asked on

php session loop

hi
i have php session which is hanged and its behaving very unusually
elseif (in_array($_GET['menu'],array('start','process')))
{
    if (!$_SESSION["current_question"])
    {
        $_SESSION["current_question"] = 0;
    }
    
    $_SESSION["current_question"]++;

Open in new window

Avatar of prokvk
prokvk

Can you paste your finish.php script pls ?
Avatar of mattibutt

ASKER

below is the finish script

<br>
<table width="60%"  align="center" cellspacing="0px" cellpadding="0px" style="border-collapse: collapse">
<tr>
<td style="width:33; height:33; background-image:url(../images/blocks/topleft.png);"></td>
<td style="background-image:url(images/blocks/top.png); height:33; text-align:center; padding-bottom:10" colspan="0"><font size="2" face="Bitstream Vera Sans Mono"><strong>Results</strong></font></td>
<td style="width:33; height:33; background-image:url(images/blocks/topright.png);" ></td>
</tr>
</table>
<table width="60%"  align="center" cellspacing="0px" cellpadding="0px" style="border-collapse: collapse">
<tr >
<td style="width:10;background-image:url(images/blocks/left.png);background-repeat:repeat-y" ></td>
<td ><table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#28C0FD" width="40%" align="right"><strong >Quiz ID &raquo;</strong>&nbsp;</td>
<td bgcolor="#005080" width="60%" align="center"><strong ><font color="#FFFFFF"><?php echo $_SESSION['quiz_id']; ?></font></strong>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#005080" width="40%" align="right"><strong ><font color="#FFFFFF">Full Name &raquo;</font></strong>&nbsp;</td>
<td bgcolor="#28C0FD" width="60%" align="center"><strong ></strong><?php echo $_SESSION['full_name']; ?>&nbsp;</td>
</tr>
 
 
<tr>
<td bgcolor="#005080" width="40%" align="right"><strong ><font color="#FFFFFF">Email ID &raquo;</font></strong>&nbsp;</td>
<td bgcolor="#28ffff" width="60%" align="center"><strong ></strong><?php echo $_SESSION['email']; ?>&nbsp;</td>
</tr>
 
<tr>
<td bgcolor="#28C0FD" width="40%" align="right"><strong >Date  &raquo;</strong>&nbsp;</td>
<td bgcolor="#005080" width="60%" align="center"><strong ><font color="#FFFFFF"><?php echo $_SESSION['quiz_date']; ?></font></strong>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#005080" width="40%" align="right"><strong ><font color="#FFFFFF">Time &raquo;</font></strong>&nbsp;</td>
<td bgcolor="#28C0FD" width="60%" align="center"><strong ></strong><?php echo $_SESSION['quiz_time']; ?>&nbsp;</td>
</tr>
 
<tr>
<td bgcolor="#28C0FD" width="40%" align="right"><strong >Total Questions &raquo;</strong>&nbsp;</td>
<td bgcolor="#005080" width="60%" align="center"><strong ><font color="#FFFFFF"><?php echo $_SESSION['quiz_total_question']; ?></font></strong>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#005080" width="40%" align="right"><strong ><font color="#FFFFFF">Correct &raquo;</font></strong>&nbsp;</td>
<td bgcolor="#28C0FD" width="60%" align="center"><strong ></strong><?php echo $_SESSION['quiz_correct_ans']; ?>&nbsp;</td>
</tr>
 
<tr>
<td bgcolor="#28C0FD" width="40%" align="right"><strong >Wrong Answered &raquo;</strong>&nbsp;</td>
<td bgcolor="#005080" width="60%" align="center"><strong ><font color="#FFFFFF"><?php echo $_SESSION['quiz_wrong_ans']; ?></font></strong>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#005080" width="40%" align="right"><strong ><font color="#FFFFFF">Unanswered &raquo;</font></strong>&nbsp;</td>
<td bgcolor="#28C0FD" width="60%" align="center"><strong ></strong><?php echo $_SESSION['quiz_unanswered']; ?>&nbsp;</td>
</tr>
 
<tr>
<td bgcolor="#28C0FD" width="40%" align="right"><strong >Total Time &raquo;</strong>&nbsp;</td>
<td bgcolor="#005080" width="60%" align="center"><strong ><font color="#FFFFFF"><?php echo $_SESSION['quiz_time_min']; ?> min</font></strong>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#005080" width="40%" align="right"><strong ><font color="#FFFFFF">Time Unused &raquo;</font></strong>&nbsp;</td>
<td bgcolor="#28C0FD" width="60%" align="center"><strong ></strong><?php echo $_SESSION['quiz_time_unused']; ?>&nbsp;Seconds</td>
</tr>
 
 
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="50%" height="50" bgcolor="#FF9900" align="center"><font face="Bitstream Vera Sans Mono" size="+2"><b>GRADE <?php echo $_SESSION['quiz_grade']; ?></b></font></td>
<td width="50%" align="center"><font face="Bitstream Vera Sans Mono" size="+2"><b><?php echo $_SESSION['quiz_score']; ?>%</b></font></td>
</tr>
</table></td>
<td style="background-image:url(images/blocks/right.png);background-repeat: repeat-y; background-position:right; width:10" ></td>
</tr>
</table>
<table width="60%"  align="center" cellspacing="0px" cellpadding="0px" style="border-collapse: collapse">
<tr >
<td style="width:32; height:36; background-image:url(images/blocks/bottomleft.png);" ></td>
<td style="background-image:url(images/blocks/bottom.png); height:36; text-align:center; padding-bottom:10" colspan="0"><font face="Bitstream Vera Sans Mono" size="2">&laquo;<a href="answer.php" style="color:#CCCCCC; text-decoration:none"  target="_blank">View Answers</a>&raquo;</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font face="Bitstream Vera Sans Mono" size="2">&laquo;<a href="index.php" style="color:#CCCCCC; text-decoration:none"  target="_self">New Quiz</a>&raquo;</font>&nbsp;</td>
<td style="width:32; height:36; background-image:url(images/blocks/bottomright.png);background-position:right" ></td>
</tr>
 
</table>

Open in new window

Err ... Do your quiz finish successfully and with another quiz start this problem arrives ?? Or not even first quiz finishes successfully ?
the first quiz finish fine then problem start and it stays for hours
ASKER CERTIFIED SOLUTION
Avatar of prokvk
prokvk

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
wow its done thank you sooooooooo  much  one thing i will have one or two question related to this quiz , is it ok if i follow you when i have them
very nice buddy i really appreciate it
problem is now its letting me do the quiz but not able to hold more then one question answer
unanswered.jpg
I will look at it when I get some sleep dude ;) I'm tired, it's 02:19 here ;)
ok i wanted to go to sleep as well but i thoguht its rude while u r helping me lol laters good nite
i have posted as a new question as this is another kind of weird problem
https://www.experts-exchange.com/questions/24186405/php-session-array-problem.html