Re: Mangled Data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18.10.2021 at 18:59, John wrote:

> Solution, forwarded to PHP list:
> ================================
>
> OK, solved this.
>
> The form input MUST be contained in SINGLE quotes; probably to avoid
> being manipulated by the PHP parser.  Double quotes or no quotes don't
> work.
>
> Example:
>
> <input type="hidden" name="trans" id="trans" value='<?php echo
> $data ?>'>
>
> where $data is the incoming JSON data string.
>
> Thanks for your assistance.

Thanks for providing a solution, but I suggest to properly entity-encode
$data anyway, e.g. like

  <input type="hidden" name="trans" id="trans"
value="<?=htmlspecialchars($data)?>">

--
Christoph M. Becker




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux