-2
Like I do to change the title
of the sticky pages in the friendly URL?
below follows the friendly url script
<div id="conteudo">
<?php
$url = $_GET['url'];
$quebraUrl = explode('/', $url);
$categoria = $quebraUrl[0];
$paginas = array('home', 'empresa', 'servicos', 'produtos', 'noticias', 'dicas', 'fale-conosco');
//HOME
if(!isset($categoria) || $categoria == ''){
include("paginas/home.php");
}
//PAGINAS FIXAS
else if(isset($categoria) && in_array($categoria, $paginas)){
include("paginas/".$categoria.".php");
}
?>
</div>
and below the menu.php
<div id="menu">
<ul id="categoria">
<a href="<?php echo URLBASE; ?>/home" title="#"><li>HOME</li></a>
<a href="<?php echo URLBASE; ?>/cursos" title="#"><li>CURSOS</li></a>
<a href="<?php echo URLBASE; ?>/video-aulas" title="#"><li>VÍDEO AULAS</li></a>
<a href="<?php echo URLBASE; ?>/artigos" title="#"><li>ARTIGOS</li></a>
<a href="<?php echo URLBASE; ?>/tutoriais" title="#"><li>TUTORIAIS</li></a>
<a href="<?php echo URLBASE; ?>/dicas" title="#"><li>DICAS</li></a>
<a href="<?php echo URLBASE; ?>/noticias" title="#"><li>NOTÍCIAS</li></a>
<a href="<?php echo URLBASE; ?>/fale-conosco" title="#"><li>FALE CONOSCO</li></a>
</ul>
</div>
and below the header.php
<?php require_once("sistema/config.php"); require_once("sistema/funcoes.php"); error_reporting(0); ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Project WEB - Códigos, Scripts, Dicas de Programação e muito mais!</title>
<link href="<?php echo URLBASE; ?>/css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- CORPO -->
<div id="corpo">
<!-- HEADER -->
<div id="header">
<!-- LOGO -->
<div id="logo">
<a href="<?php echo URLBASE; ?>/home" title=""><img src="<?php echo URLBASE; ?>/imagens/logo.png" alt="imagens/logo.png" title="Project WEB - Códigos, Scripts, Dicas de Programação e muito mais!"></a>
</div>
<!-- MENU -->
<?php include_once("includes/menu.php"); ?>
</div>
Hello Hello, there is a horizontal menu and I am using url friendly, but the title of the pages does not exchange, I would like you to exchange
– user15180
The title is defined within the tag
title
in thehead
. You know how to do that?– Sergio
sincerely not Would you help me please
– user15180
Okay, better. One more question: You’re opening different pages and files, right? When you use this:
<a href="<?php echo URLBASE; ?>/home" title="#"><li>HOME</li></a>
so you don’t pass any GET or POST parameters... this is just the code you have? you have a PHP file for each page?– Sergio
That’s all I have: a header.php menu.php and content.php
– user15180
Hi charlie, I wish that by clicking on a certain page you change the title, the way this title does not change, the page changes and the title remains the same could help me
– user15180
You need to set a variable to use it within the title tag.
– Papa Charlie
don’t know how, could help me charlie I’m not very good at php I’m learning
– user15180
Okay, why don’t you use the friendly url template I went through instead of what you use? Create a var
$teste ="meu titulo";
and in the title use<title><php? echo $teste; ?></title>
– Papa Charlie
what model charlie ? I’m not seeing
– user15180
I believe that the set of classes here http://github.com/szagot/config will help you to work separation, in particular the class Uri (http://github.com/szagot/config#Uri).
– Szag-Ot