i am trying to pass the variable to next page via session using PHP. below code save the last value . i want to pass the 'name' when user clicks on "More Info " link,there i will display more information about clicked Name.
<?php while ($r = $q->fetch()):
$city=$r['city'];
$phone=$r['phone'];
$name=$r['name'];
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
$_SESSION['name'] = $name;
$_SESSION['phone'] = $phone;
$_SESSION['city'] = $city;
?>
<tr>
<td><?php echo (++$i); ?></td>
<td><?php echo htmlspecialchars($name) ?></td>
<td><?php echo htmlspecialchars($phone); ?></td>
<td><?php echo htmlspecialchars($city); ?></td>
<td> <a href="more_info.php" >More Info</a></td>
</tr>
<?php endwhile; ?>