Forum Moderators: phranque

Message Too Old, No Replies

IP based condition toggles PHP directive

         

Thanasus

10:11 pm on May 30, 2004 (gmt 0)

10+ Year Member



I am trying to figure out a way to toggle the display errors directive for PHP, if and only if the visitng IP is a particular one. THis way error display can be enabled if its from my IP but others wont see the errors.

gergoe

12:38 am on May 31, 2004 (gmt 0)

10+ Year Member



I don't think there's any way to do this in Apache, unless you can redirect the browser in the case of an error to a new page, which can be restricted then.

This is strictly a php related question; try posting it on the php forum instead, the chance that you'll get your question answered is much bigger than here.

ogletree

12:41 am on May 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



When you do your error code do an if statement that includes $_SERVER['REMOTE_ADDR']that will return the ip of the person looking at the page.

To find out exactly what you will return there put

<?php
echo $_SERVER['HTTP_REFERER'];
?>

on that page and have the if statment only show your errors there.