Search code examples
smarty

Smarty check if URL contains some value


I use smarty and I want to check if my currenty URL contains some value. Therefore I use the following code, but that does not work.

{if $smarty.server.HTTP_REFERER|strstr:'domain=transfer&sld='}

The full URL;

https://example.com/cart.php?a=add&domain=transfer&sld=value&tld=.com

What am I missing?


Solution

  • Try REQUEST_URI instead of HTTP_REFERER.

    This will do it.