How to dynamically populate page title from link selection

157 views Asked by At

I have a alphabetical links at the top of the page like A,B,C,D...Z. Clicking on each letter loads the data with that letter below. What I would like is to dynamically change the page title when the letter is clicked.

For example, clicking on "A", the page title would say:

"Your are browsing letter A"

Here is the php code I use for this section.

$popis=range("A", "Z");
echo "<center>";
foreach ($popis as $key => $value) {
    echo '<a href="index.php?id='.$value.'">'."[".$value."]</a>";
}

echo "<br>";

if (!isset($_GET["id"])) {  
    $_GET["id"]="A";
}
0

There are 0 answers