I am writing some error handling into my PHP application. The problem is, when an error occurs, the standard PHP error stuff shows up in addition to the error message I coded to show up. For example, here is a certain piece of code:
$fp = fsockopen("$server", $port, $errno, $errstr, 60);
$this->ERROR = "Could not connect: Error [$errno] [$errstr]";
This is some code to connect to a server. If I enter an invalid server name, the following shows up:
Warning: fsockopen() [function.fsockopen]: php_hostconnect: connect failed in /var/www/dev.headlevel.com/htdocs/headmail/v2/headmail.php on line 19
Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:999 in /var/www/dev.headlevel.com/htdocs/headmail/v2/headmail.php on line 19
Could not connect: Error  [Connection refused]
So I just want to know how to remove the first messages, and leave my own.