Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   @ before functions??? (http://www.programmingforums.org/showthread.php?t=13149)

pegasus001 May 13th, 2007 11:53 AM

@ before functions???
 
Well the title is self explanatory, i have seen this used a lot of times but dont know the difference :
Are the same :
:

$link = mysql_connect("localhost", "root", "pass")
and
:

$link = @mysql_connect("localhost", "root", "pass")

If not what is the difference.

DaWei May 13th, 2007 2:17 PM

The @ suppresses error output to the page. Needless to say, you shouldn't resort to it until the code is released. Released code should have a mechanism to log errors or notify the author by email, or something.

Wizard1988 May 13th, 2007 3:06 PM

Yeah, like dawei said it tells the function not to print errors. Information like that could possibly be used to break in.

pegasus001 May 14th, 2007 1:56 PM

Thanx guys, for the help.


All times are GMT -5. The time now is 10:22 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC