Jump to content

Affixing Form GET Query to End of Existing Query?


Anti-Moronic

Recommended Posts

Say I have this query:

 

site.com?var=1

 

..I have a form with 'var2' field which submits via get.

 

Is there a way to produce:

 

site.com?var=1&var2=formdata

 

I was hoping there would be a quick way to affix, but can't find any info. Also, the query could sometimes be:

 

site.com?var2=formdata&var=1

 

I would have to produce:

 

site.com?var2=updatedformdata&var=1

 

Is my only option to further parse the query?

Link to comment
Share on other sites

You would need to store the original GET name/values as hidden fields in the second form, which would then be alongside the form values when submitted.

 

Incidently, you could use POST for the second form in this case, and your original GET values will be part of the POST data

Link to comment
Share on other sites

Thanks Pikachu - I am already parsing the query string but whereas my other variables are set via the actual query string, this is set via the form and must be. Therefore, the GET overwrites my previous query string.

 

I've used the hidden form elements which is working fantastic! I will likely add a layer and abstract the whole thing later but for now it's working so I can reduce priority.

 

Thanks again!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.