Page 1 of 1

% sign!

Posted: Mon Feb 12, 2007 5:27 pm
by spacebiscuit
Hi,

I am using 'define' to print a message to the screen which includes the % sign:

define('TEXT_ORDER_FORCED_QUANTITY_AMOUNT', 'Your current order qualifies for a 12 percent discount');

I am having to use wording in place of the % sign as if I use the sign the page will not parse correctly. I have tried using a forward and back slash to escape the % sign but this does not work. How is it done?

Thanks,

Rob.

Posted: Mon Feb 12, 2007 5:41 pm
by Luke
maybe use it's entity value?
replace % with & #37; and let me know what happens. (take out the space between & and #)

(I'm not sure I understand your question, but try it anyway)

Posted: Mon Feb 12, 2007 5:45 pm
by pickle
I'm not sure what you mean by 'parse correctly'. Is the PHP parser throwing errors or does the resulting HTML page not render properly?

If your problem is the former, the PHP errors should guide you. If it's the latter, do what ~TNSG said & replace it with it's character code.

Posted: Mon Feb 12, 2007 6:17 pm
by spacebiscuit
Thanks for the replies....

I don't have the error output switched on my server - I just get a blank white page which is what usually happens when there is an error on my page.

I tried substituting '& #37;' for '%' but this just outputs '& #37;' to the screen and not the sign!

How easy is it to swtich the error output on, perhaps this will help narrow the problem down?

An odd one!

Rob.

Posted: Mon Feb 12, 2007 6:30 pm
by Luke
I told you to take out the space between the & and the #

Code: Select all

%

Posted: Mon Feb 12, 2007 6:54 pm
by spacebiscuit
Works perfectly - thanks!

Rob.