How can I get id of page?
I have list of 30 links, they look like:
http://test.com/composition.php?=9
Here is my code:
(index.php)
<?
$q = array();
if (mysqli_num_rows($result) > 0) {
while ($row = mysqli_fetch_assoc($result)) {
$q[$row['id']]=$row['header'];
}
}
?>
<?
foreach($q as $href => $text)
{
echo '<a href="http://test.com/composition.php?=' . $href . '">' .'<li>'. $text .'</li>' .'</a>';
}
?>
How can i get $href at page composition.php when i click on link?
I tried $_SESSION[href]=$href; - but it always shows me the last id of all links (=30) and i need that one i have clicked.
I'm sorry for noob question, I'm new to php and don't know hove to solve this problem.