Re: Writing double-prime to file? [message #184796 is a reply to message #184792] |
Sun, 02 February 2014 18:33 |
adrian
Messages: 27 Registered: December 2012
Karma:
|
Junior Member |
|
|
Denis McMahon <denismfmcmahon(at)gmail(dot)com> wrote:
> On Sat, 01 Feb 2014 18:00:30 +0000, Adrian Tuddenham wrote:
>
>> I did not think I was outputting the variable to HTML, the handler for
>> that code is written in PHP (although it does generate some HTML, but
>> the problem occurs before that bit).
>
> Regardless of how the data gets there, you're placing the string contents
> of the variable concerned in the value attribute of an input element in
> an html document.
>
> The attributes of the html input element are probably defined as follows:
>
> <input type="hidden" name="something" value="something">
>
> The web browser only receives and processes html, so if you write the
> string
>
> The quick brown "fox" jumps over the lazy dog
>
> into the value field, then the html parser in the web browser sees:
>
> <input type="hidden" name="something" value="The quick brown "fox" jumps
> over the lazy dog">
>
> It parses this into the following:
>
> An input element
>
> with type attribute of value "hidden"
>
> and name attribute of value "something"
>
> and value attribute of value "The quick brown "
>
> and fox attribute of value true (which it may treat as garbage
> and discard)
>
> and a string of " jumps over the lazy dog" (which it probably
> treats as garbage and discards)
Thanks. This solves the puzzle, although it does raise the question of
how the same string got through the previous POST without this
happening. Now I know what I am looking for. I'll have a better chance
of sorting it out.
--
~ Adrian Tuddenham ~
(Remove the ".invalid"s and add ".co.uk" to reply)
www.poppyrecords.co.uk
|
|
|