FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
/r/n characters in textarea fields
#1
I've set up a multi page form based on the form tools registration demo using the api.
On the review page carriage returns in the user data are converted to /r/n in textarea fields which is also sent to the database like this. Is this expected behaviour? can the carriage returns be maintained or the /r/n characters be removed? also ' characters are escaped with a /
Please forgive my inexperience any help on this would be great, as it is my texrarea fields are just a mess.
Reply
#2
(Feb 26th, 2010, 8:59 AM)harpon Wrote: I've set up a multi page form based on the form tools registration demo using the api.
On the review page carriage returns in the user data are converted to /r/n in textarea fields which is also sent to the database like this. Is this expected behaviour? can the carriage returns be maintained or the /r/n characters be removed? also ' characters are escaped with a /
Please forgive my inexperience any help on this would be great, as it is my texrarea fields are just a mess.

Hi,

The ' being escaped with / sounds like magic quotes might be enabled. Not sure if this would account for the /r/n behaviour though. What version of PHP are you running?

More on Magic Quotes
Reply
#3
Thanks for the reply - PHP Version 5.2.6-1+lenny4
magic_quotes_gpc Off
magic_quotes_runtime Off
magic_quotes_sybase Off
on my pc running firefox the registration demo http://demo.formtools.org/
behaves the same way, is this the same for you?
would be great to get this sorted.
Reply
#4
(Feb 27th, 2010, 11:41 AM)harpon Wrote: Thanks for the reply - PHP Version 5.2.6-1+lenny4
magic_quotes_gpc Off
magic_quotes_runtime Off
magic_quotes_sybase Off
on my pc running firefox the registration demo http://demo.formtools.org/
behaves the same way, is this the same for you?
would be great to get this sorted.

Seems like we can eiliminate magic quotes as being the cause!

When you say you are seeing this on the demo, do you mean on the admin review or when it is submitted?
Reply
#5
(Feb 28th, 2010, 7:35 AM)martin_undefined Wrote:
(Feb 27th, 2010, 11:41 AM)harpon Wrote: Thanks for the reply - PHP Version 5.2.6-1+lenny4
magic_quotes_gpc Off
magic_quotes_runtime Off
magic_quotes_sybase Off
on my pc running firefox the registration demo http://demo.formtools.org/
behaves the same way, is this the same for you?
would be great to get this sorted.

Seems like we can eiliminate magic quotes as being the cause!

When you say you are seeing this on the demo, do you mean on the admin review or when it is submitted?

thanks again for your continued support
I have attached a screen shot of the registration demo filled with the default values.
I have added some "new lines" highlighted by red to demonstrate the problem I'm having.
   
I cannot log into the admin account to view the entry in database,
so what do you think?
Reply
#6
Hmm - not actually seen this happen on any of my installs (yet). I do see the same as you when I visit the demo form.

This is making me think that it is probably something to do with mysql_real_escape_string.

So, I'm guessing that this is being employed here to stop code injections (emphasis on the guessing).

Sorry - but I can't shed any more light on it.
Reply
#7
Doesn't the creator answer questions, if he wrote it I would assume he had some insight.
Reply
#8
Hey guys,

Sorry I haven't been around much the last few days.

Interesting thread. I haven't encountered this problem on my own installations at all, but sure enough - there it is in the demo.

I'm afraid I'll need some time to investigate this. I'll let you know when I figure something out.

- Ben
Reply
#9
Bringing it to the top as it has not been fixed yet.
Oh an clean up all that oil whille your at it. JK and sarcasm is all I can afford sorry.
Reply
#10
This works for me:

PHP Code:
<textarea name=message><?=stripslashes(str_replace('\r\n'"\n"$fields["message"]))?></textarea> 

You can check it here (please, don't send us any submissions, it's not demo form Wink)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)