-
Mar 17, 2005, 09:29 AM
#1
suppressing warnings?
Is there a way to suppress warnings that php spits out. I wrote a script that is suppose to open a socket and when it doesn't it will say "Connection failed!!"
e.g.
<?php
$conn = fsockopen("192.168.0.1","5083")
if (!$conn) {
echo 'Connection Failed!!';
}
?>
I want the connection to fail seeing it's just a test. But php prints out it's warning + mine. So the question again is can i suppress the php wanrings??
-
Mar 17, 2005, 10:39 AM
#2
Re: suppressing warnings?
Placing a '@' at the begining of the line with the probable error will supress PHP's message.
@$conn = fsockopen("192.168.0.1","5083") ;
-
Mar 17, 2005, 11:09 AM
#3
Re: suppressing warnings?
ahhh yes, respect Cknight.... death_knight u nuh have not a use!!
-
Apr 20, 2005, 04:47 PM
#4
you could also turn of displaying of warnings in php.ini to affect all pages, or also you could use functions ini_set or error_reporting to affect just one page that you are working with.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules