Adding a registrar to production

I make some changes on a real site, and I constantly need to add loggers (print_r) to the whole page for verification. The problem is that the site is healed by employees, and I need it, so I know for sure what this registrar is. I heard that I can wrap the logger in an if file with my Ip address, but I thought that while I was trying to do this, the client was still looking at it. Does anyone have any ideas or syntax needed for this. By the way, I think the PHP version is older than

+4
source share
4 answers

You can always pass yourself a variable in get and enable it

http://mysite.com?debug=secret

then

if($_GET['debug'] === "secret"){ print_r($stuff); } 

Before I used the frameworks, I used to set cookies when debug = "secret", so I don’t have to set all the time. And since you only have a set of cookies, you're fine.

+7
source

This limits //your debug code IP 12.34.56.78.

 if(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] == '12.34.56.78'){ //your debug code } 

You can also save this in a constant:

define('SHOWDEBUG', isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] == '12.34.56.78');

Somewhere else: SHOWDEBUG && print_r($dumped);

+2
source

Create a page that allows you to set or clear the "debug" cookie. Make sure you put the password on this page so that the client cannot do it.

+1
source

agreed with lznogood.

I would add some secret
<?php
$a=$_GET[];
if($a=xyz){
}
?>
note: it would not hurt to get some encrypted value equal to some other large encrypted value. then just tag it for yourself and install in code.

I have this activity on my page for marking // connection reasons.

0
source

All Articles