#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    35
    Rep Power
    14
    I have a search page to search the database, the input from user are include 4 items:

    keywords
    country
    catalog
    date

    the results are divided into pages by date desc, so there are PREV10 1 2 3 ... NEXT10 to indicate the page number.

    Then, How can I pass the 4 items and the page number to next page? I don't wont to use urlencode() and urldecode() because there will be long url in IE's address.

    I try to set the $HTTP_POST_VARS as cookie, so my code is here:

    ----------------------------code-

    if ( !isset($SEARCH) | | !isset($HTTP_POST_VARS) )
    Header("Location: $HTTP_REFERRER");
    exit;
    }

    if ( isset($HTTP_POST_VARS) ) {
    $frm = $HTTP_POST_VARS;
    setcookie("SEARCH",$frm,time()+3600);
    }


    $frm = $SEARCH;
    if ( !isset($frm["keywords"]) ) {
    Header("Location: $HTTP_REFERRER");
    exit;
    }

    do_search_process();

    ----------------------------------------code+

    In my codes, setcookie() is inserted into two Header(), is it right?

    Anyone has a good idea? I badly need that.
    thanks.


    ------------------
    Good Good Study
    Day Day Up

    [This message has been edited by xiaoguiwxd (edited September 19, 2000).]
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    19
    Rep Power
    0
    hi,

    you could just have a form redirecting to your search script on your page with hidden values for keywords, country, catalog, date.

    Use different names for your submit button next and prev, and check their values in your script to know what to do next... You don't have to use big ugly buttons. You may create small good looking images.

    I hope this helps,


    Bakassi.


    [This message has been edited by bakassi (edited September 19, 2000).]
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    35
    Rep Power
    14
    My navigate bar is:

    prev10 1 2 3 4 5 6 7 8 9 10 next10

    when someone click next10, it will be

    prev10 11 12 13 14 15 16 17 18 19 20 next10

    Did u mean I shall store hundreds of images for the page number?

    thanks
    your idea is great... Mm.. create a form all hidden fields.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    19
    Rep Power
    0
    Check out google.com, they use images I think... i thought of small icons because I don't really like standard buttons... You won't need to store hundreds of images... i don't know what your graphic design is going to be like, but You could easily find way to work around it .

    Bakassi
  8. #5
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    If you do not mind a bit of javascript....

    page numbers can be links ie:
    <form name="bella" method="post">
    data...
    </form>

    then your page numbers..
    <a href="javascript:go(1)">1</a>
    <a href="javascript:go(2)">2</a> etc etc

    function go() looks like this..
    <script>function go(num){
    document.bella.action="resultspage.htm?id=num";
    document.bella.submit()
    }</script>

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL

Similar Threads

  1. Replies: 4
    Last Post: February 13th, 2004, 03:31 PM
  2. Replies: 1
    Last Post: February 10th, 2004, 08:22 PM
  3. Pass a varaible to another page (parent)
    By sanj in forum HTML Programming
    Replies: 2
    Last Post: February 6th, 2004, 12:59 PM
  4. how to pass a variable into <!-- #exec cgi=
    By drojdest_b in forum Perl Programming
    Replies: 0
    Last Post: February 4th, 2004, 02:29 PM
  5. pass value from one php page to another php page
    By fluke_tony in forum PHP Development
    Replies: 4
    Last Post: January 27th, 2004, 09:55 PM

IMN logo majestic logo threadwatch logo seochat tools logo