I want paging is a content of a news blog. Everything works correctly, the page content is successful. But I get an error screen displays PHP:
Notice: Undefined index: page in C:\wamp\www\index.php on line 146
code with the line that gives the error:
$maxreg = 1;
$pag = $_GET['page'];
if (!isset($pag) || empty($pag)){
$min = 0;
$pag = 1;
}else{
if($pag == 1){
$min = 0;
}else{
$min = $maxreg * $pag;
$min = $min - $maxreg;
}
}
include("js/class.AutoPagination.php");
$obj = new AutoPagination(contar_contenido(), $pag);
mostrar_contenido($min,$maxreg);
echo $obj->_paginateDetails();
The line gives the error is this:
$ page = $ _GET ['page'];
The first page by default index.php and contains no var in the url. I do not understand why if fails below by a conditional var I determine if that has content or not.
Should not show any error php, could someone give me a solution? Thanks