Problem keeping a variable in the receiving page.
From the index.php, the taskid is sent to the receiving page projectasessment.php and this works, the varialble is received.
problem is in the receiving page projectassessment.php (data entry form) it wont keep the variable when it returns back to the same page.
- projectassessment page receives the variable $_GET['taskid']; - works
- user clicks the save button to save the data.
- after saving the page the page returns back to projectassessment.php to add another record.
- at this stage $_SESSION['taskid'] = $_GET['taskid']; becomes blank.
I'm assuming when the page returns back to projectassessment the $_get returns a blank as it has no values to return and in turn the session variable is blank.
can any one recommend an alternative option to keep the session variable live?
index.php
while($row = mysqli_fetch_assoc($ProjectListResults))
{ echo '<tr>';
echo "<td> <a href='projectassessment.php?taskid=" .$row['ci_taskid'] . " ' > " . $row['ci_taskid'] . "</a></td>";
echo '<td>' . $row['ci_firstname'] . ' '.$row['ci_lastname']. '</td>';
echo '<td>' . $row['ci_projectid']. '</td>';
echo '<td>' . $row['ci_sde'] . '</td>';
echo '<td>' . $row['ci_status']. '</td>';
echo '<td>' . $row['ci_title']. '</td>';
echo '</tr>';
}
projectassessment.php
<?php
session_start();
echo $_SESSION['taskid'] = $_GET['taskid'];
...
?>