Dont display php warnings

Dont display php warnings

Postby mancub on Wed Nov 19, 2008 2:03 pm

I have a php web page that I am writing and I want it to look for a file called debug.cfg and then send debug info to the screen. If it cant find the file I want it to just run normally. So i look for the file with

require_once "debug.cfg"

But when the file dosent exist I get warnings on the screen. Is there anyway I can accomplish this without getting all the warnings on the screen saying it cant find the file?

User avatar
mancub
Newbie
Newbie
 
Posts: 18
Joined: Fri Jan 19, 2007 10:37 am

Re: Dont display php warnings

Postby Darwin on Wed Nov 19, 2008 2:08 pm

You can add the @ symbol in front of any function you call to supress error messages.

@require_once "debug.cfg";

should work nicely for you

User avatar
Darwin
Jr. Member
Jr. Member
 
Posts: 93
Joined: Mon Oct 09, 2006 11:16 am
Location: Bradenton, FL


Return to PHP

Who is online

Users browsing this forum: No registered users and 0 guests

cron