FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » POST data being truncated at "
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
POST data being truncated at " [message #180140] Sat, 12 January 2013 16:44 Go to next message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma: 0
Senior Member
Script 1: I collect data, including a textarea - submitted via AJAX
Script 2: I retrieve the data from the POST var and collate the
data and create a human readable report which is put into a
hidden field - submitted via AJAX
Script 3: I retrieve the data from the POST var write the data to
disk

The data collected in form 1 has an embeded quote: "ok" which is
passed via the POST array to form 2 without error.

When the report (which contains the textarea containing the
quote) passes from Script 2 to Script 3 the report is truncated
just before the quote.

Do I need to encode the report befoe putting it into a hidden
form field ?
or, anyone have any suggestions on how to debug this ?

-bill
Re: POST data being truncated at " [message #180141 is a reply to message #180140] Sat, 12 January 2013 17:02 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 12/01/13 16:44, bill wrote:
> Script 1: I collect data, including a textarea - submitted via AJAX
> Script 2: I retrieve the data from the POST var and collate the data and
> create a human readable report which is put into a hidden field -
> submitted via AJAX
> Script 3: I retrieve the data from the POST var write the data to disk
>
> The data collected in form 1 has an embeded quote: "ok" which is passed
> via the POST array to form 2 without error.
>
> When the report (which contains the textarea containing the quote)
> passes from Script 2 to Script 3 the report is truncated just before the
> quote.
>
> Do I need to encode the report befoe putting it into a hidden form field ?

yes.
there are a couple of commands to so this - I think htmlspecialchars
will cover the case.


> or, anyone have any suggestions on how to debug this ?
>
> -bill


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: POST data being truncated at " [message #180142 is a reply to message #180140] Sat, 12 January 2013 21:27 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 1/12/2013 11:44 AM, bill wrote:
> Script 1: I collect data, including a textarea - submitted via AJAX
> Script 2: I retrieve the data from the POST var and collate the data and
> create a human readable report which is put into a hidden field -
> submitted via AJAX
> Script 3: I retrieve the data from the POST var write the data to disk
>
> The data collected in form 1 has an embeded quote: "ok" which is passed
> via the POST array to form 2 without error.
>
> When the report (which contains the textarea containing the quote)
> passes from Script 2 to Script 3 the report is truncated just before the
> quote.
>
> Do I need to encode the report befoe putting it into a hidden form field ?
> or, anyone have any suggestions on how to debug this ?
>
> -bill

Yes, you do. But why are you passing it in a hidden field? Passing via
the session is safer, more efficient and generally a better idea.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: POST data being truncated at " [message #180143 is a reply to message #180142] Sun, 13 January 2013 10:31 Go to previous messageGo to next message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma: 0
Senior Member
On 1/12/2013 4:27 PM, Jerry Stuckle wrote:
> On 1/12/2013 11:44 AM, bill wrote:
>> Script 1: I collect data, including a textarea - submitted via
>> AJAX
>> Script 2: I retrieve the data from the POST var and collate the
>> data and
>> create a human readable report which is put into a hidden field -
>> submitted via AJAX
>> Script 3: I retrieve the data from the POST var write the data
>> to disk
>>
>> The data collected in form 1 has an embeded quote: "ok" which
>> is passed
>> via the POST array to form 2 without error.
>>
>> When the report (which contains the textarea containing the quote)
>> passes from Script 2 to Script 3 the report is truncated just
>> before the
>> quote.
>>
>> Do I need to encode the report befoe putting it into a hidden
>> form field ?
>> or, anyone have any suggestions on how to debug this ?
>>
>> -bill
>
> Yes, you do. But why are you passing it in a hidden field?
> Passing via the session is safer, more efficient and generally a
> better idea.
>
I can't think of one good reason. I just got in the habit of
using the session for long term storage and POST for script to
script communication.

will re-think that.
Thanks

-bill
Re: POST data being truncated at " [message #180144 is a reply to message #180141] Sun, 13 January 2013 10:32 Go to previous messageGo to next message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma: 0
Senior Member
On 1/12/2013 12:02 PM, The Natural Philosopher wrote:
> On 12/01/13 16:44, bill wrote:
>> Script 1: I collect data, including a textarea - submitted via
>> AJAX
>> Script 2: I retrieve the data from the POST var and collate the
>> data and
>> create a human readable report which is put into a hidden field -
>> submitted via AJAX
>> Script 3: I retrieve the data from the POST var write the data
>> to disk
>>
>> The data collected in form 1 has an embeded quote: "ok" which
>> is passed
>> via the POST array to form 2 without error.
>>
>> When the report (which contains the textarea containing the quote)
>> passes from Script 2 to Script 3 the report is truncated just
>> before the
>> quote.
>>
>> Do I need to encode the report befoe putting it into a hidden
>> form field ?
>
> yes.
> there are a couple of commands to so this - I think
> htmlspecialchars will cover the case.
>
Thanks NP
-bill
Re: POST data being truncated at " [message #180145 is a reply to message #180143] Sun, 13 January 2013 10:40 Go to previous messageGo to next message
M. Strobel is currently offline  M. Strobel
Messages: 386
Registered: December 2011
Karma: 0
Senior Member
Am 13.01.2013 11:31, schrieb bill:
> On 1/12/2013 4:27 PM, Jerry Stuckle wrote:
>> On 1/12/2013 11:44 AM, bill wrote:
>>> Script 1: I collect data, including a textarea - submitted via
>>> AJAX
>>> Script 2: I retrieve the data from the POST var and collate the
>>> data and
>>> create a human readable report which is put into a hidden field -
>>> submitted via AJAX
>>> Script 3: I retrieve the data from the POST var write the data
>>> to disk
>>>
>>> The data collected in form 1 has an embeded quote: "ok" which
>>> is passed
>>> via the POST array to form 2 without error.
>>>
>>> When the report (which contains the textarea containing the quote)
>>> passes from Script 2 to Script 3 the report is truncated just
>>> before the
>>> quote.
>>>
>>> Do I need to encode the report befoe putting it into a hidden
>>> form field ?
>>> or, anyone have any suggestions on how to debug this ?
>>>
>>> -bill
>>
>> Yes, you do. But why are you passing it in a hidden field?
>> Passing via the session is safer, more efficient and generally a
>> better idea.
>>
> I can't think of one good reason. I just got in the habit of using the session for
> long term storage and POST for script to script communication.

What is long term? For me long term data is in the database.

The session is good for data between requests, and it is secure i.e. the client can
not manipulate it, and it is local to the server.

/Str.
Re: POST data being truncated at " [message #180146 is a reply to message #180145] Mon, 14 January 2013 12:45 Go to previous messageGo to next message
bill is currently offline  bill
Messages: 310
Registered: October 2010
Karma: 0
Senior Member
On 1/13/2013 5:40 AM, M. Strobel wrote:
> Am 13.01.2013 11:31, schrieb bill:
>> On 1/12/2013 4:27 PM, Jerry Stuckle wrote:
>>> On 1/12/2013 11:44 AM, bill wrote:
>>>> Script 1: I collect data, including a textarea - submitted via
>>>> AJAX
>>>> Script 2: I retrieve the data from the POST var and collate the
>>>> data and
>>>> create a human readable report which is put into a hidden field -
>>>> submitted via AJAX
>>>> Script 3: I retrieve the data from the POST var write the data
>>>> to disk
>>>>
>>>> The data collected in form 1 has an embeded quote: "ok" which
>>>> is passed
>>>> via the POST array to form 2 without error.
>>>>
>>>> When the report (which contains the textarea containing the quote)
>>>> passes from Script 2 to Script 3 the report is truncated just
>>>> before the
>>>> quote.
>>>>
>>>> Do I need to encode the report befoe putting it into a hidden
>>>> form field ?
>>>> or, anyone have any suggestions on how to debug this ?
>>>>
>>>> -bill
>>>
>>> Yes, you do. But why are you passing it in a hidden field?
>>> Passing via the session is safer, more efficient and generally a
>>> better idea.
>>>
>> I can't think of one good reason. I just got in the habit of using the session for
>> long term storage and POST for script to script communication.
>
> What is long term? For me long term data is in the database.
>
> The session is good for data between requests, and it is secure i.e. the client can
> not manipulate it, and it is local to the server.
>
> /Str.
>


For me "long-term" was for the user session, from login to logout.
However, I have seen the light. I recoded using $_SESSION and
all is well.

bill
Re: POST data being truncated at " [message #180152 is a reply to message #180140] Tue, 15 January 2013 23:16 Go to previous message
richard is currently offline  richard   
Messages: 213
Registered: June 2013
Karma: 0
Senior Member
On Sat, 12 Jan 2013 11:44:28 -0500, bill wrote:

> Script 1: I collect data, including a textarea - submitted via AJAX
> Script 2: I retrieve the data from the POST var and collate the
> data and create a human readable report which is put into a
> hidden field - submitted via AJAX
> Script 3: I retrieve the data from the POST var write the data to
> disk
>
> The data collected in form 1 has an embeded quote: "ok" which is
> passed via the POST array to form 2 without error.
>
> When the report (which contains the textarea containing the
> quote) passes from Script 2 to Script 3 the report is truncated
> just before the quote.
>
> Do I need to encode the report befoe putting it into a hidden
> form field ?
> or, anyone have any suggestions on how to debug this ?
>
> -bill

use "ok"
or use 'ok'
double quotes mark the beginning and end of a string.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Anyone have experience with any php debuggers?
Next Topic: QR Code>/phpqrcode/qrlib.php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 10:23:11 GMT 2024

Total time taken to generate the page: 0.02426 seconds