SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist dscriptor's Avatar
    Join Date
    Oct 2005
    Location
    in front of my computer
    Posts
    571
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Google-like Page Numbering (Problem)

    hi all,

    im using the code posted in
    google page numbering code

    it displays something like this

    -item
    -item
    -item
    -item
    -item

    Pages: 1 2 3 4 Next>

    but the problem is when i click the NEXT or the number, it doesn't display the next 5 items that should be displayed...

    what do you think is the problem here..? please help,
    thanks.

  2. #2
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to get the page number passed via the request. Add this to the top of your script:
    PHP Code:
    $page intval($_GET['page']); 
    Christopher

  3. #3
    SitePoint Evangelist dscriptor's Avatar
    Join Date
    Oct 2005
    Location
    in front of my computer
    Posts
    571
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, i'll try it. thanks..

  4. #4
    SitePoint Evangelist dscriptor's Avatar
    Join Date
    Oct 2005
    Location
    in front of my computer
    Posts
    571
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey, thanks a lot! it works fine!

  5. #5
    SitePoint Wizard
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,672
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remember whenever you get values from the Request (i.e $_GET, $_POST, $_REQUEST, $_COOKIE) to make sure you ALWAYS filter the values to prevent injection attacks. I used intval() above which is a simple way for integers. Use preg_replace() or similar for more complex values to make sure that you are only getting the characters that you need.
    Christopher


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •