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?

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

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.