1

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";
}
mplungjan
  • 169,008
  • 28
  • 173
  • 236
  • Here is a link about setting the page title with PHP: http://stackoverflow.com/questions/3463716/set-page-title-using-php p.s. You should tag this as "PHP" so it shows up in the correct language filters. – Eric Burdo Jan 04 '17 at 17:57
  • You mean `echo "You are browsing ".$_GET["id"]."";` ? – mplungjan Jan 04 '17 at 17:57
  • 1
    PS: $_GET["id"]="A"; is not likely something you want to do (assignment not test which is ==). – mplungjan Jan 04 '17 at 18:11

0 Answers0