dashboard.php
<table border="1">
<tr>
<!-- <tr> -->
<?php
$i = 1;
if($pager->paginate())
{
$result = $pager->paginate();
while($data = mysql_fetch_assoc($result))
{
?>
<td></td>
<td><a href="dashboard.php"><img src="images/<?php echo $data['newfilename']; ?>" height="150px" width="150px"><?php
$filename = $data['newfilename'];
//echo $filename;
$_SESSION['class'] = $data['class'];
//$_SESSION['echo $filename']; ?><br><br><?php echo $data['class']; ?></a>
<a href="#" onclick="doSomething();">Click Me!</a>
<?php
if($i % 5 == 0){
echo '<br>';
echo '<tr>';
}
$i++;
}
}
?>
</td>
<?php /*
<td><a href="#"><img src="../../images/Computer.jpg" height="150px" width="150px"><br><br>Computer Class</a></td>
<td><a href="#"><img src="../../images/history.gif" height="150px" width="150px"><br><br>History Class</a></td>
</tr>
<tr>
<td><a href="#"><img src="../../images/Math.png" height="150px" width="150px"><br><br>Math Class</a></td>
<td><a href="#"><img src="../../images/Social.png" height="150px" width="150px"><br><br>Social Class</a></td>
<td><a href="#"><img src="../../images/Tutorial.jpg" height="150px" width="150px"><br><br>Tutorial</a></td>*/ ?>
<!-- </tr> -->
</tr>
</table>
Hello,
I am trying to echo class and when someone click the echo class - the session that is being registered is the session that is equal to the class that being clicked, instead of the last class row in the table. How to create such program ? How to fix my program?
// the following logic only shows the last row that appears in the table
$_SESSION['class'] = $data['class'];
<br><br><?php echo $data['class']; ?>