How to change the title of the title tag and meta description according to the content

0

my web page is shaped by modules and I only have one cache, that is to say

    <html>
    <head>
        <title>ejemplo</title>
        <meta name="description" content="ejemplo" />
    </head>
    <body>
    <header>
     link1  link2   link3
    </header>

 <?php

    if(isset($_GET["view"])){

        include"modules/".$_GET["view"].".php";
     }else{

          include"modules/home.php";
       }

  ?>

the other content after the body I bring from other files with the super Global GET according to the link clicked, my question is how can I change the title and the description of the meta tag as brought with the variable $_GET["view"] .

this I need to improve the positioning of my page in google and that users find my page according to what they are looking for, some help plis? thanks

    
asked by andy gibbs 03.12.2018 в 19:37
source

1 answer

0

You would use something like (with JavaScript):

document.getElementsByTagName('meta')["description"].content = "Mi nueva descripción"; 
document.title = "Mi nuevo título"; 

Here is the answer on which I base myself to solve something similar that I implemented.

link

I hope my answer can help you out of something.

    
answered by 03.12.2018 в 19:56