Display code or content for selected IP only

Last update: 10 Січня, 2023

Category: PHP code examples

Tags: .

Example code below. To display your IP, uncomment the line with “echo”:

<?php
$visit_ip = $_SERVER["REMOTE_ADDR"];

/* echo $visit_ip; */

/* Change to your IP */
if ($visit_ip != '00.00.00.00') {

/* hidden code or content */ ?>

<!-- a place to insert html code -->

<?php } ?>