SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Pragmatic Programmer halfasleeps's Avatar
    Join Date
    Feb 2006
    Location
    Altoona, PA. USA
    Posts
    1,945
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    get variables not sending?

    i have a form like this to select how many products per page like this


    PHP Code:
    $other_vars $_SERVER['QUERY_STRING'];
                
    $other_vars str_replace('per_page','as8dK7xf',$other_vars);
                
    $opt_per '<form action="category.php?'.$other_vars.'" method="get">'
    the entire form may look like this:
    HTML Code:
    <form action="category.php?cid=88" method="get">
    <span>1</span>
    <a href="category.php?cid=88&page=2&per_page=24">2</a>
    <a href="category.php?cid=88&page=2&per_page=24">NEXT></a>
    Show <select id="per_page" name="per_page">
    <option  value="12">12</option>
    <option selected="selected" value="24">24</option>
    <option  value="50">50</option>
    </select> 
    Per Page <input id="submit" type="submit" value="Go">
    </form>
    I did this so whenever the submit button is clicked and the get vars are sent I don't whip out the original get vars(except the per_page var) I just add to them.

    but the original get vars are going away even tho I am clearly adding them to the action="" I don't understand? these get vars are important for the page to know what content to load...I can't have them going away.

    Also I originally made this a POST form but then when someone clicked a product then it the back button it said "page expired" so I changed to GET and now I have this problem.....

    Any help on how to fix this would be great.

    THANKS!
    Altoona Design
    Freelance Flex developer for hire.
    ActionScript Programmer with 8 Years Experience.

  2. #2
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I dont follow you reasoning in your code above.

    Why not save your query string in a SESSION_VARIABLE then you wont have to bother retrieving it and filtering it every time.
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  3. #3
    Pragmatic Programmer halfasleeps's Avatar
    Join Date
    Feb 2006
    Location
    Altoona, PA. USA
    Posts
    1,945
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks mandes.....I don;t know why it never dawned on me to use sessions....its not like I never used them before lol.....but yea I'll try that. thanks.
    Altoona Design
    Freelance Flex developer for hire.
    ActionScript Programmer with 8 Years Experience.


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
  •