homepage Welcome to WebmasterWorld Guest from 54.227.34.0
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
show error report only to me ?
john1000

5+ Year Member



 
Msg#: 3584949 posted 1:53 pm on Feb 26, 2008 (gmt 0)

Hi,

Is there a way to show the errror_report only to me ?
I meanmy host has it turned of which i dont mind..as i can turn it on ny adding php_flag display_errors on to my htaccess.

But if i turn it on everybody will see the errors and thats not nice to work with.
is there a way that it will only show to me as admin or to IP ?

 

jatar_k

WebmasterWorld Administrator jatar_k us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3584949 posted 2:21 pm on Feb 26, 2008 (gmt 0)

you could set display errors based on ip

something like

if ($_SERVER['REMOTE_ADDR'] == 'your ip here') {
ini_set('display_errors', '1');
}

mipapage

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3584949 posted 2:37 pm on Feb 26, 2008 (gmt 0)

Another idea, not so easy as jatar_k's, would be to use Firefox's UA cloaking add on. Create a custom UA string and serve errors if that string is found:

if ($_SERVER['HTTP_USER_AGENT'] == 'custom_user_agent') {
ini_set('display_errors', '1');
}

I find this works well when, say, three people are working on a site from different locations/ips. They can all work in 'dev mode' - so to speak.

john1000

5+ Year Member



 
Msg#: 3584949 posted 3:09 pm on Feb 26, 2008 (gmt 0)

thanks guys, both ways are nice to play with .
Thank you :)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved