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

    Join Date
    Jan 2011
    Posts
    51
    Rep Power
    4

    Form input doesn't go further than 1st page in pagination


    I'm having a problem with paginating a search function: the first page is displayed perfectly but all the other pages are empty and state that I haven't entered anything in the form. I figured that the form input isn't transported to the second or third page, etc.

    So how would I tackle this best? Should I put a script to all the links to other resultpages that repost the input through a hidden form or what would you suggest? How would such a link look like?

    <a ???>...</a>


    I defined my search term as a var like this:
    $search = mysql_real_escape_string($_POST["search"]);
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,115
    Rep Power
    9398
    Sessions are easier to use. You can put the data in there and test for/access it on the other pages.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    51
    Rep Power
    4
    Originally Posted by requinix
    Sessions are easier to use. You can put the data in there and test for/access it on the other pages.
    is it possible to do something like <form action="session">...</form>
  6. #4
  7. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,115
    Rep Power
    9398
    No, but you can easily do it yourself:
    PHP Code:
    $_SESSION["form1"] = $_POST
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    51
    Rep Power
    4
    Ok, thnx

    that work'd after I changed
    PHP Code:
    $_SESSION["form1"] = $_POST
    to
    PHP Code:
    $_SESSION["form1"] = $_POST["form1"]; 
    I tried sessions before to work around this problem but I didn't get it right...

    Thanks a lot

IMN logo majestic logo threadwatch logo seochat tools logo