Quoted text disapearing in text input boxes

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
clem_c_rock
Forum Commoner
Posts: 46
Joined: Mon Jun 07, 2004 9:18 am

Quoted text disapearing in text input boxes

Post by clem_c_rock »

Hello,

This is rather embarassing given my 4 years of php coding experience but I've noticed when I'm pulling quoted text from a database into a input text field, the entire text w/in the quotes, and the quotes themselves disappears.

For instance, if I try to echo this string: this is "text", only the string: this is will show up in the text input box.

I know there has to something stupid I'm missing

Thanks,
Clem C
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Quoted text disapearing in text input boxes

Post by alex.barylski »

clem_c_rock wrote:Hello,

This is rather embarassing given my 4 years of php coding experience but I've noticed when I'm pulling quoted text from a database into a input text field, the entire text w/in the quotes, and the quotes themselves disappears.

For instance, if I try to echo this string: this is "text", only the string: this is will show up in the text input box.

I know there has to something stupid I'm missing

Thanks,
Clem C
So, only when you pull text from a database? or when you also echo quoted text?

Code: Select all

echo 'This is some "quoted text"';
Is your text stored in a DB as completely quoted? Single quote or double quotes?

You should provide more details...might be something your doing with addslashes() or failing to do...who knows...

p.s-Why is any question embarrising?

Thats the beauty of computers and programming ...the more you know...the more you realize the less you know... :)

Sorry I couldn't be of more help, but i've never experienced a problem like this...

Cheers :)
clem_c_rock
Forum Commoner
Posts: 46
Joined: Mon Jun 07, 2004 9:18 am

Post by clem_c_rock »

Ah - great - the combonation of <?=stripslashes( htmlentities( $var ) ) ?> worked beautifully.

Why haven't I ever used htmlentities()?

Thanks again all

Much obliged!
Post Reply