Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,072
    Thanks
    26
    Thanked 0 Times in 0 Posts

    Sorting without JavaScript

    How can I make it so when someone submits a form, the sort criteria are updated in the URL so I can then grab the values in the $_GET array and use it to sort the page without using JavaScript?

    Sincerely,


    Debbie

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,096
    Thanks
    23
    Thanked 594 Times in 593 Posts
    PHP has a sort() for arrays just like JS. There are 5 of them:

    sort() - sort arrays in ascending order
    rsort() - sort arrays in descending order
    asort() - sort associative arrays in ascending order, according to the value
    ksort() - sort associative arrays in ascending order, according to the key
    arsort() - sort associative arrays in descending order, according to the value
    krsort() - sort associative arrays in descending order, according to the key
    Hope this helps
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,072
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    PHP has a sort() for arrays just like JS. There are 5 of them:

    sort() - sort arrays in ascending order
    rsort() - sort arrays in descending order
    asort() - sort associative arrays in ascending order, according to the value
    ksort() - sort associative arrays in ascending order, according to the key
    arsort() - sort associative arrays in descending order, according to the value
    krsort() - sort associative arrays in descending order, according to the key
    Hope this helps
    That has nothing to do with what I asked...

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,096
    Thanks
    23
    Thanked 594 Times in 593 Posts
    What did you ask? To me sort and sort criteria deal with arrays. Please explain more fully.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #5
    Senior Coder doubledee's Avatar
    Join Date
    Mar 2011
    Location
    Arizona
    Posts
    1,072
    Thanks
    26
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    What did you ask? To me sort and sort criteria deal with arrays. Please explain more fully.
    Let me create a new thread which does a better job explaining what I'm stuck on...


    Debbie


  •  

    Posting Permissions

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