<?php require_once('conexao.php');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Páginação de Conteúdo Simples</title>
<style>
/*PAGINAÇÃO DE CONTEÚDO*/
.paginacao{width: 100%; margin-top: 5px; float: left;}
.paginacao a{color:#fff; padding:3px 5px; border:1px solid #06F; text-decoration:none; margin:0 3px; background: #069; float: left; margin-bottom: 5px; margin-left: 5px; font-family: Verdana, Geneva, sans-serif; font-size:14px;}

.paginacao a:hover{background:#09f; color:#fff;}
</style>
<!-- P.S:   O CSS DA PAGINAÇÃO FICA A SEU CRITÉRIO, FAÇA DO MODO QUE ACHAR MELHOR -->
</head>

<body>
 <?php

if(!$_GET["pag"]){

$inicio = 0;

}else{

$inicio = ($_GET["pag"]*10)-10;

}


$registro = mysql_query("SELECT * FROM noticia  LIMIT $inicio,10");
$numTotalpag = ceil(mysql_num_rows($registro)/10);

?>

 <div class="paginacao"> 
	<?php for($x=1; $x<=$numTotalpag; $x++){  echo "<a href='categorias-noticias.php?pag=$x'>$x</a>&nbsp;&nbsp; "; }?>
    </div>
</body>
</html>