Re: Writing double-prime to file? [message #184792 is a reply to message #184789] |
Sat, 01 February 2014 19:26 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma:
|
Senior Member |
|
|
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)
--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
|
|
|