exemplo:
http://localhost/cursos/prophp/projeto/cat.../entretenimento
aparece a url certinho mas fala assim:
A URL solicitada / cursos / prophp / projeto / categoria / Entretenimento no se encontró en este servidor.
pagina que recebe a url codigo abaixo :
<?php
$catUrl = mysql_real_escape_string($url[1]);
$readCat = read('up_cat',"WHERE url = '$catUrl'");
if(!$readCat){
header('Location: '.BASE.'/404' );
}else
foreach($readCat as $cat);
setViews($cat['id']);
?>
<title><?php echo $cat['nome'].' | '.SITENAME;?></title>
<meta name="title" content="<?php echo SITENAME.' | '.$cat['nome'];?>" />
<meta name="description" content="<?php echo $art['content'];?> " />
<meta name="keywords" content="PALAVRAS CHAVE DA PÁGINA" />
<meta name="author" content="AUTOR DO SITE" />
<meta name="url" content="<?php echo BASE.'/categoria/'.$cat['url'];?>" />
<meta name="language" content="pt-br" />
<meta name="robots" content="INDEX,FOLLOW" />
</head>
<body>
<div id="site">
<?php setArq('tpl/header'); ?>
<div id="content">
<div class="categoria">
<h1 ><?php echo $cat['nome'];?></h1>
<?php
echo'<ul class="arts">';
$pag = (empty($url[3]) ? '1' : $url[3]);
$maximo = 6;
$inicio = ($pag * $maximo) - $maximo;
if($cat['id_pai'] != ''){
$readArtigos = read('up_posts',"WHERE categoria = '$cat[id]' AND tipo = 'post' AND status = '1' ORDER BY data DESC LIMIT $inicio, $maximo");
}else{
$readArtigos = read('up_posts',"WHERE cat_pai = '$cat[id]' AND tipo = 'post' AND status = '1' ORDER BY data DESC LIMIT $inicio, $maximo");
}
foreach($readArtigos as $art):
$catcon++;
echo'<li';
if($gbnum%4==0) echo ' class="last"';
echo'>';
getThumb($art['img'], $art['tags'], $art['titulo'], '200','150','','',BASE.'/artigo/'.$art['url']);
echo' <p class="data"> '.date('d/m/Y :i',strtotime($art['data'])).'</p>';
echo' <p class="titulo"><a title="ver mais '.$art['titulo'].'" href="'.BASE.'/artigo/'.$art['url'].'" class="link">'.lmWord($art['titulo'],50).'</a></p>';
echo'</li>';
endforeach;
echo'</ul>';
$link = BASE.'/categoria/'.$cat['url'].'/page/';
if($cat['id_pai'] != ''){
readPaginator('up_posts',"WHERE categoria = '$cat[id]' AND tipo = 'post' AND status = '1' ORDER BY data DESC ", $maximo, $link, $pag,'870px');
}else{
readPaginator('up_posts',"WHERE cat_pai = '$cat[id]' AND tipo = 'post' AND status = '1' ORDER BY data DESC ", $maximo, $link, $pag,'870px');
}
?>
Question
naldo_10
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.