Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6546585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:43:31+00:00 2026-05-25T11:43:31+00:00

I have downloaded the pagination code and used it for my website running on

  • 0

I have downloaded the pagination code and used it for my website running on my local machine. After modifying and testing, there was a problem where it does not recognize the variable $page.

Please refer to the following code:

<?php
    $rpp = 3; // results per page
    $adjacents = 4;
    $page = intval($_GET["page"]);
    if($page<=0) $page = 1;
    $reload = $_SERVER['PHP_SELF'];
    $sql = "SELECT * FROM ".TABLE_IMAGE." ORDER BY id ASC";
    $qry = mysql_query($sql, $con);
    // count total number of appropriate listings:
    $tcount = mysql_num_rows($qry);

    // count number of pages:
    $tpages = ($tcount) ? ceil($tcount/$rpp) : 1; // total pages, last page number

    $i = 1;
    $count = 0;
    $j = ($page-1)*$rpp;
    while(($result = mysql_fetch_array($qry)) && (($count<$rpp) && ($j<$tcount))){
        $id = $result['id'];
        $img = $result['path'];
        $title = $result['title'];
        $detail = $result['detail'];
        $priority = $result['priority'];
        $active = $result['isActive'];
 ?>
<div id="block-image-slider"  class="<?php echo(($i%2==0)?'even':'odd')?>">
    <h2><?php echo $title ?></h2><span class="operation">[<a href="?action=edit&section=slider&id=<?php echo $id ?>">កែប្រែ</a>|<a href="?action=delete&section=slider&id='<?php echo $id ?>'">លុប</a>]</span>
    <div class="block-slider-image-body">
        <div class="left">
            <ul>
                <li>លេខរៀងទី<span class="space"><?php echo $id ?></span></li>
                <li>កំនត់អទិភាពទី<span class="space"><?php echo $priority ?></span></li>
                <li>ត្រូវបានបង្ហាញអោយឃើញ<span class="space"><?php echo (($active==1)?'បង្ហាញ':'មិនបង្ហាញ')?></span></li>
                <li>អត្ថបទពេញ<div class="detail"><?php echo $detail ?></div></li>
            </ul>
        </div>
        <div class="right">
            <img src="<?php echo '../../image/Slider/'.$img ?>" alt="<?php echo $title ?>" width="170" height="100" />
        </div>
        <div style="clear:both;"></div>
  </div>
</div>
<?php
        mysql_data_seek($qry,$j);

        $i++;
        $j++;
        $count++;
}//end of while loop

include("../include/paginate.php");
echo paginate_three($reload, $page, $tpages, $adjacents);
?>

This is the error it generated:

Notice: Undefined index: page in C:\wamp\www\1. Chirst Joy Church Website\common\admin\index.php on line 87

How can I fix this error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:43:32+00:00Added an answer on May 25, 2026 at 11:43 am

    This won’t work unless your URL ends with ?page=3 (where 3 would be the current page number). In order to fix it you should change this line

    $page = intval($_GET["page"]);
    

    to

    $page = (!empty($_GET["page"]) ? intval($_GET["page"]) : 1);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have downloaded a website using HTtrack wepsite copier. All files are downloaded to
I have downloaded TableView sample code '4_TableViewCellSubviews' from internet. I am trying to run
I have downloaded and installed linq-to-sqlite from http://sqlite.phxsoftware.com/ But the following test code: [
I have downloaded the example code/demo from: http://www.technowise.in/2009/12/uploadify-aspnet-c-vb-examples-demo.html and when I try to run
I have downloaded an application from internet(from Chrome browser) named a.app, and there will
I have downloaded cppcheck tool and build it. Now am facing the problem that
I have downloaded a MetaTrader MQL4 language .mq4 source-code file from here and I
quick pagination i have downloaded the pagination from this site, ya really fine ,
I have downloaded the worpress from online. The following code is in config.php. define('AUTH_KEY',
I have downloaded some Java source code from a book. It contains many directories

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.