Forum Moderators: coopster

Message Too Old, No Replies

Single Quote in Text Area

Hnadle Single quote in Textarea / Text area for form

         

vikaspa

8:39 am on Nov 29, 2003 (gmt 0)

10+ Year Member



I could record an address with single quote with the help of mysql_escape_string()

However when I read the same record and display it in text field
I found that it gets truncated
I mean
following line

Roger's Flavour Manufacturer

is displayed as

Roger

Further string is omitted
Why such thing happend and how do I avoid it?

Please Help

davidpbrown

8:53 am on Nov 29, 2003 (gmt 0)

10+ Year Member



addslashes() was mentioned yesterday.
Not something I've used but appears to be what your looking for.

h*tp://www.php.net/addslashes has more

dpb

coopster

4:26 pm on Nov 29, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, vikaspa!

davidpbrown is right, addslashes is probably what you are looking for. As a matter of fact, you may want to read a bit about PHP's magic_quotes [php.net] feature as it is going to be something you'll want to learn and understand.

figment88

4:29 pm on Nov 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



also if yoiu are going to redisply visitor input, you'll need to use something like htmlentities() to ensure that they did not stick HTML code in their form inputs.