Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to turn off warning when opening file fails

Status
Not open for further replies.

SM777

Technical User
Mar 7, 2001
208
GB
I open a database file. If the file is not available then PHP throws up a:

Warning: unable to open database /home/mydir/datbase.txt

How can I turn this feature off?

I detect if the file can't be opened or doesnt exist and display my own warning page but I can't get PHP to stop displaying the warning and the path to the database.

On an open error I just want to display my own warning, not PHP's internal warning too.
 
Put an @ in front of the function that generates the error. That will supress any error thrown by that function. //Daniel
 
that works a treat.

Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top