I need to check the url of a site, if it is the same www.teste.com.br/agenda, the meta name="description" will be "blablabla", if it is www.teste .com / home will be "test". How do I check the URL?
I need to check the url of a site, if it is the same www.teste.com.br/agenda, the meta name="description" will be "blablabla", if it is www.teste .com / home will be "test". How do I check the URL?
Use the variable $_SERVER['REQUEST_URI']
, it takes the supplied URI to access the current page:
if ($_SERVER['REQUEST_URI'] == "/agenda"){
echo"<meta name='description' content='Agenda Description'>";
}
else if($_SERVER['REQUEST_URI'] == "/home"){
echo"<meta name='description' content='Guia de Caxias do Sul'>";
}