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 == '141.105.193.53'}
{* other debugging code goes here *}
{/if}

Where 141.105.193.53 is your ip address.
To Get you IP address goto https://www.google.co.uk/search?q=my+ip+address

For PHP it is

Back To Top