I am using the following code - my default seting of 5 rows per page works but when I change the setting to 10 I see the first page okay and on clicking the NExt link - I see 'You are not allowed to access this URL directly, POST array is empty'
I am simply trying to paginate my query results.
I am using the following code in both - Form HTML and On SUbmit
Please help.
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("joomla15", $con);
$limit = intval( mosGetParam( $_REQUEST, 'limit', 0) );
$limitstart = intval( mosGetParam( $_REQUEST, 'limitstart', 0) );
$query = "SELECT COUNT(*) FROM jos_chronoforms_1 where Category like 'zoos'";
$database->setQuery( $query );
$total = $database->loadResult();
$limit = $limit ? $limit : 5;
if ( $total <= $limit ) {
$limitstart = 0;
}
require_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php' );
$pageNav = new mosPageNav( $total, $limitstart, $limit );
$database->setQuery( $result, $limitstart, $limit );
$query = "SELECT `name`, `address`, `state` FROM jos_chronoforms_1 where Category like 'zoos'";
$database->setQuery( $query, $limitstart, $limit );
$rows = $database -> loadObjectList();
for( $i=0; $i<count($rows); $i++ )
{
$row = $rows[$i];
echo $row->name." / ".$row->address." / ".$row->state."<br>";
}
echo $pageNav->getLimitBox($link);
echo $pageNav->writePagesLinks($link);
echo $pageNav->writePagesCounter();
mysql_close($con);
?>
I am simply trying to paginate my query results.
I am using the following code in both - Form HTML and On SUbmit
Please help.
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("joomla15", $con);
$limit = intval( mosGetParam( $_REQUEST, 'limit', 0) );
$limitstart = intval( mosGetParam( $_REQUEST, 'limitstart', 0) );
$query = "SELECT COUNT(*) FROM jos_chronoforms_1 where Category like 'zoos'";
$database->setQuery( $query );
$total = $database->loadResult();
$limit = $limit ? $limit : 5;
if ( $total <= $limit ) {
$limitstart = 0;
}
require_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php' );
$pageNav = new mosPageNav( $total, $limitstart, $limit );
$database->setQuery( $result, $limitstart, $limit );
$query = "SELECT `name`, `address`, `state` FROM jos_chronoforms_1 where Category like 'zoos'";
$database->setQuery( $query, $limitstart, $limit );
$rows = $database -> loadObjectList();
for( $i=0; $i<count($rows); $i++ )
{
$row = $rows[$i];
echo $row->name." / ".$row->address." / ".$row->state."<br>";
}
echo $pageNav->getLimitBox($link);
echo $pageNav->writePagesLinks($link);
echo $pageNav->writePagesCounter();
mysql_close($con);
?>