1

Possible Duplicate:
How can I get query string values?
How to change how the URL is encoded when a form is submitted?

I have the site where I have the form and When i push the button's send. While sending I want to program the submit is form because i want to use the other delimiter & and =. This is possible?

Now I write one example:

www.theuser.com/?Name=IBM&surname=PC

With if the function programable while sending

www.thepc.com/?Name%24+IBM+%23%+Surname%24+PC

Repeat: when I sent the parameter, I not want this separator & or = and I want to use the others.

This Query String is the original for the my project:

http://localhost:8100/index2?json_data=demo_title%24+Demo+title+%23+proc1_script%24+script.sh+parameters+%23+proc1_chk_make%24+on+%23+outputp2_value%24++%23+demo_input_description%24+hola+mundo+%23+outputp4_visible%24+on+%23+outputp4_info%24++%23+inputdata1_max_pixels%24+1024000+%23+tag%24++%23+outputp1_id%24+nanana+%23+proc1_src_compresion%24+zip+%23+proc1_chk_cmake%24+off+%23+outputp3_description%24++%23+outputp3_value%24++%23+inputdata1_description%24+input+data+description+%23+inputp2_description%24+bien%3F+%23+inputp3_description%24+funciona+%23+proc1_cmake%24+-D+CMAKE_BUILD_TYPE%3Astring%3DRelease++%23+outputp2_visible%24+on+%23+outputp3_visible%24+on+%23+outputp1_type%24+header+%23+inputp1_type%24+text+%23+demo_params_description%24+va+bien+%23+outputp1_description%24++%23+inputdata1_type%24+image2d+%23+proc1_chk_script%24+off+%23+demo_result_description%24+win%3F+%23+outputp2_id%24+nanfdsvfa+%23+inputp1_description%24+funciona+%23+demo_wait_description%24+boh+%23+outputp4_description%24++%23+inputp2_type%24+integer+%23+inputp2_id%24+papapa+%23+outputp1_value%24++%23+outputp3_id%24+nananartrtrt+%23+inputp3_id%24+pepepe+%23+outputp3_type%24+header+%23+inputp3_visible%24++off+%23+outputp1_visible%24+on+%23+inputdata1_id%24+id_lsd+%23+outputp4_value%24++%23+inputp2_visible%24+on+%23+proc1_source%24+lsd-1.5.zip+%23+inputp3_value%24+si+%23+proc1_make%24+-j4+-C++%23+images_config_file%24+cfgmydemo.cfg+%23+outputp2_type%24+header+%23+proc1_subdir%24+xxx-1.5+%23+proc1_url%24+http%3A%2F%2Fwww.ipol.im%2Fpub%2Falgo%2F...+%23+inputdata1_image_depth%24+1x8i+%23+inputp1_id%24+popopo+%23+inputp1_value%24+si+%23+inputp2_value%24+no+%23+demo_data_filename%24+data_saved.cfg+%23+inputdata1_info%24+info_lsd+%23+outputp3_info%24++%23+inputdata1_image_format%24+.pgm+%23+outputp1_info%24++%23+inputdata1_compress%24+False+%23+inputp1_visible%24+on+%23+proc1_id%24+lsd+%23+outputp4_id%24+nana+%23+outputp2_description%24++%23+outputp4_type%24+header+%23+outputp2_info%24++%23+inputp3_type%24+float+%23+&tag=&inputp4_id=hi&inputp4_type=text&inputp4_description=hello+program&inputp4_value=no&inputp4_info=bol&inputp4_visible=on
Community
  • 1
  • 1
  • What does this have to do with javascript/jQuery? – Mike Brant Nov 13 '12 at 00:47
  • 2
    More importantly, can I ask ***why*** you would want to use different delimiters? – ahren Nov 13 '12 at 00:53
  • @MikeBrant: I don't see another way, do you? It does not seem possible using [pure html](http://www.w3.org/TR/html401/interact/forms.html#h-17.13.3.4) – Bergi Nov 13 '12 at 01:00
  • Sorry, it's still a little unclear what you mean. Are you saying that you want the form submit to go to the second URL, `www.thepc.com/?Name%24+IBM+%23%+Surname%24+PC`? If not, post the exact URL you're looking for. – Jacob Nov 13 '12 at 01:03
  • Ehehehhe I use the server with Cherrypy and the program is with pyhton and Mako. I have the initial data with the variable Mako. I can add/Edit/Delete the new Data and at the end I collect all the data and write a new file. I use on the all forms the method GET and i use the querystring. I can't use the four delimiters (& = %24+ +%23%) because the programming is difficult. –  Nov 13 '12 at 01:04
  • This is a original Query String http://localhost:8100/index2?json_data=demo_title%24+Demo+title+%23+proc1_script%24+script.sh+parameters+%23+proc1_chk_make%24+on+%23+outputp2_value%24++%23+demo_input_description%24+hola+mundo+%23+outputp4_visible%24+on+%23+outputp4_info%24++%23+inputdata1_max_pixels%24+1024000+%23+tag%24++%23+ –  Nov 13 '12 at 01:07
  • @MikeBrant there is a solution? Change/Edit the delimiters's Query String while Send? –  Nov 13 '12 at 09:53

1 Answers1

2

tldr; The encoding is "correct"; however ..

.. something incorrectly percent encoded the full URL.

Only encode the components (keys and values), not the full URL or gibberish like this will result.

The = and & characters are valid reserved characters in the query portion of a URL and should not be encoded.

  • 1
    I can not edited the url when I sending the parameter? –  Nov 13 '12 at 01:11
  • 1
    @begginnerofall Sure you can - just make sure to encode it *correctly*, which might be "don't encode it twice" or "encode it by component". Provided details of *how* this URL was construct and *how* it is used in the post would be beneficial. –  Nov 13 '12 at 01:48