views:

155

answers:

3

I have a form with method="get". In the form I need to pass the URL of a CSS file but it is encoding it to http%3A%2F%2Fwww... etc.

Is there a way to stop the encoding of the URL as it is breaking the file.

Thanks

+1  A: 

No, you can't. The encoding is required to make a valid URL.

Instead, decode the value in your receiving code (what platform are you on anyways, URL decoding is usually done automatically for you)

Matti Virkkunen
I am posting to an iframe, that is the problem, from just an html page
kristina
@kristina: I don't see how that makes any difference
Matti Virkkunen
A: 

No for security reason you can't do that. You have to collect decoded it at the receiving end.

Salil
darn,thanks for your help anyway
kristina
+1  A: 
Abel
becuase I am passing the value to an iframe I cannot decode on that end. All I need to do is pass the css path<input type="hidden" name="css" value="http://www.site/css/basket.css" /> But this is then passed as an encoded path and not picked up?
kristina
@kristina: what happens on the receiving end of the chain? I.e., you've set a URL in the target-attribute of the `<iframe>` element. That page must know how about the CSS-parameter, the name, and how to access the value. Just applying some hidden input field with the name "css" is not going to magically change the css stylesheet of the page, unless the page is programmed to do so.
Abel