How to pass quotes in a encoded format?
| From: | Netto | Date: | Mon, 22 Dec 2003 14:09:57 +0000 |
| Subject: | How to pass quotes in a encoded format? | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10734@lists.php.net to get a copy of this message | ||
Hi there,...
I couldn't figure out why smarty makes my "nome_usu+LIKE+%27%25ab%25%27"
string passed trought an assign into a "name+LIKE+'%ab%'" string...
I'm using Smarty 2.6.0 stable release...
I need the the string like the first way cause it will be passed in a
variable through GET method...
So it must become something like this:
myLink.php?condition=name+LIKE+%27%25ab%25%27 (I'm sure its really like this
since I use urlencode() on it before assigning to the template), but Smarty
always gives me:
myLink.php?condition=name+LIKE+'%ab%' and I can't have that so my GET won't
work out...
Any ideas to make Smarty output the way I need?
Thank you...
Netto
An test code should be:
$condition = "name like '%ab%'";
$tpl = new Smarty();
(...)
$tpl->assign('condition', urlencode($condition));
(...)