SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2002
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fulltext search results and pagination

    I'm having troubles with the following scenario:

    I have a fulltext index in mysql, a form on index.php and a results page - search.php

    initially, the form posts the query variable to the search page, which works fine. I choose to iterate through the results via pagination. On the "next" page however, I lose my query. The page is just reloaded with different parameters passed into the url.

    Ok, so the POST'd variable isn't being passed when PHP_SELF is called by the pagination. I enclosed the "next" link in a form, with hidden values set to what was POST'd from the index.php. I added an onclick function to submit the form to search.php (itself) hoping it would re-POST the variables. However, this didn't happen.

    Of course, if I hard code the query into search.php, everything works fine.

    Any help would be appreciated.
    Coupons, Deals, and Online Specials:
    http://www.couponsurfers.com

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds like you are using $_POST to hold the search text, then using $_GET for the pagination which would loose the original posted search text.
    Most sites (see google) just pass the search text via GET in the url, i.e index.php would use <form method="GET" rather than POST


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
  •