Walle;10940785 wrote:<select name="set">
<option value="?p=1&p=3">Test</option>
index.php?set=%3Fp%3D1%26p%3D3
but want like this instead index.php?set=1&set=3
This has nothing to do with charecter encoding, but url encoding. See RFC 1738
RFC1738 wrote:
In addition, octets may be encoded by a character triplet consisting
of the character "%" followed by the two hexadecimal digits (from
"0123456789ABCDEF") which forming the hexadecimal value of the octet.
(The characters "abcdef" may also be used in hexadecimal encodings.)
Octets must be encoded if they have no corresponding graphic
character within the US-ASCII coded character set, if the use of the
corresponding character is unsafe, or if the corresponding character
is reserved for some other interpretation within the particular URL
scheme.
The reason for all this is that you'd get unexpected results otherwise. Consider
<form>
<select name="set">
<option value="1&unset=1">1</option>
</select>
</form>
Your form contains one form element, set, and as such the server should not be expected to end up with two (or more) variables depending on what value set has. set on the other hand, should be expected to contain the value "1&unset=1".
You are probably also missing the difference between what's in the address bar of a web browser, and what's in PHP's $GET array. In the address bar, the form element values are url encoded, in the $GET array they are not.
Finally, you should validate your html code. Not using & when you want to display & will generate a couple of errors.
The "&" entity is the "&" character for display purposes. The "&" character however, is the starting character for character entities, and the ; is the ending character for those entities. & is just one of them.
And if you are confused about & since it displays '&' and also contains it, consider the two entities:
< (displays <)
> (displays >)
And then consider the diifference in what's displayed in these two blocks
<h2>Div</h2>
<div>
<div></div>
</div>
<h2>Div</h2>
<div>
<div></div>
</div>