Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 938703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:41:05+00:00 2026-05-15T21:41:05+00:00

often I find myself suprized about simple things, I’m not sure but I believe

  • 0

often I find myself suprized about simple things, I’m not sure but I believe that this might be one of them.

Often I find myself needing to merge get attributes, especially within filters and search pages within sites. This come be at times quite complicated, as you might want to remove and add parameters dynamically.

Simple way to do it is to use a form, but this get complicated, when adding elements that don’t belong within a form. e.g. pagination

For example I might have a URL such as the following

http://www.example.org/ninja_search/?speed__gt=5&night_sight=1&page=1

How would I merge such URL with page=2, substituting the 1 with the new value? Is javascript the only option?

?speed__gt=5&night_sight=1&page=1 + page=2 = ?speed__gt=5&night_sight=1&page=2

Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:41:05+00:00Added an answer on May 15, 2026 at 9:41 pm

    The solution is to use [] to explicitly create an array from the parameters, providing your server side language supports it:

    ?speed__gt=5&night_sight=1&page[]=1&page[]=2

    For example, if your server-side language is PHP, $_GET['page'] will now return an array with 1 as the first element and 2 as the second.

    You can use this technique in forms too, by applying it to the name attribute:

    <form id="myform">
      <input type="hidden" name="page[]" value="1" />
      <input type="hidden" name="page[]" value="2" />
    </form>
    

    If you’re talking about adding a second parameter and ignoring the first, this will happen anyway – the second provided parameter will override the first. Assuming

    ?speed__gt=5&night_sight=1&page=1&page=2

    The value of page at the server will be 2, because the last value given takes priority.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I often find myself doing things like this when manipulating tables:- $($('table tr').children()[2]).html(); For
I often find myself designing simple little web projects that are serving up aggregate
I'm not great with MySQL, so I often find myself preparing sub-optimal queries that
This is a very simple question. I often find myself wanting to create a
I often find myself wanting to debug CSS layout issues that involve DOM changes
I often find myself needing reference to an object that is several objects away,
I often find myself with a list of disconnected Linq2Sql objects or keys that
I often find myself with a file that has one number per line. I
I often find myself executing commands like this at bash : history | grep
While striving for const-correctness, I often find myself writing code such as this class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.