damon2003
01-13-2004, 03:14 PM
Hi,
I have a variable that contains info about a product - its code, description and price. For various reasons I have to store this info as a concatenated value, each part separated by ---, and put it in a checkbox
1111---DESCRIPTION OF PRODUCT---36.00
I can echo this ok to a page, but if there happens to be a double quotation mark in the description, then storing this value in the checkbox becomes a problem.
For example if the if the value is the following:
1111---21" TV---36.00
then the value stored in the checkbox becomes:
1111---21
its as though the quotation is being taken literally, and ending the value. This is what I used to write the checkbox to the page
echo "<input type=\"checkbox\" name=\"checkbox$varincrement\" value=\"$productInformation\" checked=\"checked\">";
where $productInformation is the concatenated value above. Does anyone one know how to solve this?
thanks a lot
I have a variable that contains info about a product - its code, description and price. For various reasons I have to store this info as a concatenated value, each part separated by ---, and put it in a checkbox
1111---DESCRIPTION OF PRODUCT---36.00
I can echo this ok to a page, but if there happens to be a double quotation mark in the description, then storing this value in the checkbox becomes a problem.
For example if the if the value is the following:
1111---21" TV---36.00
then the value stored in the checkbox becomes:
1111---21
its as though the quotation is being taken literally, and ending the value. This is what I used to write the checkbox to the page
echo "<input type=\"checkbox\" name=\"checkbox$varincrement\" value=\"$productInformation\" checked=\"checked\">";
where $productInformation is the concatenated value above. Does anyone one know how to solve this?
thanks a lot