Avatar of mattibutt
mattibutt
Flag 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

PHP

Avatar of undefined
Last Comment
mattibutt

8/22/2022 - Mon
prokvk

Can you paste your finish.php script pls ?
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

prokvk

Err ... Do your quiz finish successfully and with another quiz start this problem arrives ?? Or not even first quiz finishes successfully ?
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
mattibutt

ASKER
the first quiz finish fine then problem start and it stays for hours
ASKER CERTIFIED SOLUTION
prokvk

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
mattibutt

ASKER
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
mattibutt

ASKER
very nice buddy i really appreciate it
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
mattibutt

ASKER
problem is now its letting me do the quiz but not able to hold more then one question answer
unanswered.jpg
prokvk

I will look at it when I get some sleep dude ;) I'm tired, it's 02:19 here ;)
mattibutt

ASKER
ok i wanted to go to sleep as well but i thoguht its rude while u r helping me lol laters good nite
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
mattibutt

ASKER
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