skip to Main Content

Smarty Debug Code to only show content for your own ip address

Smarty Debug Code To Only Show Content For Your Own Ip Address

In Smarty templating code you sometimes just want to show content to a specific IP address. This is ideal for trying something on the live site but only you can see what is happening.

{if $smarty.server.REMOTE_ADDR == ''}
{* other debugging code goes here *}

Where is your ip address.
To Get you IP address goto

If you are using a Web Firewall such as Sucuri then you will need to use the following instead.

{if $smarty.server.HTTP_X_SUCURI_CLIENTIP == ''}
{* other debugging code goes here *}

For PHP it is

Back To Top