Page 1 of 1

double quote problem

Posted: Mon Jan 19, 2009 10:06 pm
by Da_Elf
I'm populating a popup menu with some options stored in a mysql database. for the option im using this

<option value="<?=stripslashes($newaa['GalProse'])?>"><?=stripslashes($newaa["GalProseName"])?></option>

with this though if there is a double quote it wont show up. On the reverse.......

<option value='<?=stripslashes($newaa["GalProse"])?>'><?=stripslashes($newaa["GalProseName"])?></option>

.....i wont get single quotes

Re: double quote problem

Posted: Mon Jan 19, 2009 10:16 pm
by Burrito
huh?

stripslashes() will remove any slashes thereby removing the escape from your quotes. What is your problem exactly? Your first post is very vague.

Re: double quote problem

Posted: Mon Jan 19, 2009 10:23 pm
by Da_Elf
if ive got an entry in my mysql database under GalProse
entry = We'll say "hello"

in the first option the value would loose everything after the first "
in the second option the value would loose everything after We due to the opening of quotes in the value. if i dont use quotes then the value will only be the first word

Re: double quote problem

Posted: Mon Jan 19, 2009 10:26 pm
by Burrito
so then pick a quoting type, stripslashes() and replace the chosen quote type with \%quotetype%

Re: double quote problem

Posted: Mon Jan 19, 2009 10:40 pm
by Da_Elf
i dont get what you mean by /%quote type%

Re: double quote problem

Posted: Tue Jan 20, 2009 9:33 am
by Da_Elf
i still cant find anything on google for that

Re: double quote problem

Posted: Tue Jan 20, 2009 9:37 am
by Burrito
%quotetype% is just whichever quote type you choose to use (double or single) for your <select> boxes.

Re: double quote problem

Posted: Tue Jan 20, 2009 9:41 am
by Da_Elf
im not the one who will be inputting data into the mysql database. so ill have to leave a disclaimer letting people know to use single quotes only rather than double quotes.