-4

I wonder how do I create a status from not complete into completed. The 'not complete' is a link from menu page where the user, after click the link, it redirect to survey module.

My question is how if the user submit the survey module and redirect back to menu page, and at the same time the status change to 'completed'.

Kindly need a guidance and recommendation. TQ.

Below is my code for more understanding :

     
   <table border="1" align="center" cellpadding="0" cellspacing="0">
    <tr><td>
     <table border="1" cellpadding="7" width="630" cellspacing="1">
     <tr>
     <th><font size=2>Modul</font></th>
     <th><font size=2>Status</font></th>
     </tr>
     <tr><td><font size=2><center>Modul 1<td><a href="indsurvey1.php"><center><font size=2>Not complete</a></td>
     <tr><td><font size=2><center>Modul 2<td><a href="indsurvey2.php"><center><font size=2>Not complete</a></td>
     <tr><td><font size=2><center>Modul 3<td><a href="indsurvey3.php"><center><font size=2>Not complete</a></td>
     <tr><td><font size=2><center>Modul 4<td><a href="indsurvey4.php"><center><font size=2>Not complete</a></td>
     </table>
    </td></tr>
   </table>
Daario
  • 23
  • 1
  • 9
  • 1
    TLI: Too Little Information – Class Nov 06 '14 at 06:50
  • How can you expect us understand what is *status*,*complete* etc without looking at your code and knowing what you did and how. – Shub Nov 06 '14 at 06:51
  • You can achieve this by using querystring or session or cookies. Once user submit the survey module set session/cookeis value to completed or anything else and you can check on menu page for the same value and if it is set then just change the status to complete. – Rajinder Chandel Nov 06 '14 at 06:53

1 Answers1

0

From my best understanding, i feel you need to manage status flag while moving from one page to another.

For this you may use Session variable and initialize it with 'not complete' and manipulate it accordingly.

For example :

 $_SESSION['Status']='not complete';

 function menu()
 {
  if(status1 == true) 
 {
 $_SESSION['status'] = 'complete';
 }
 else 
 {
 echo 'not complete';
 } 
 }

Hope it helps!

Antariksh
  • 508
  • 8
  • 17
  • Use session to manage the status variable. and change the value of status as and when needed – Antariksh Nov 13 '14 at 08:31
  • Do the $_SESSION['Status'] need to have in database? – Daario Dec 05 '14 at 01:34
  • No not required. At the start of the action set the session variable as required then when the action is complete you may change the status of the status variable. – Antariksh Dec 06 '14 at 09:04
  • thanx..I finally can change the status by using $_SESSION ['status']. The status, after I answer the survey and redirect, did change to 'Complete'. Do you have any idea on how to stop the ahref link after the status have change to 'complete'? Meaning user cant clink the module 1, because they have completed the survey in Module 1. – Daario Dec 08 '14 at 00:24