Henk Z Henk Z - 2 months ago 18
Smarty Question

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?

Answer

Try REQUEST_URI instead of HTTP_REFERER.

This will do it.

Comments