Re: Error exits
| From: | Kent Wang | Date: | Tue, 11 Jul 2000 16:25:49 +0000 |
| Subject: | Re: Error exits | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-5942@lists.php.net to get a copy of this message | ||
>Is it possible to declare a function to handle error exits in a more
>graceful manner?
Indeed there is. Just define your function and then replace die() with it. For example
function passAway($arg) // a little more graceful than saying die
{
echo "<HTML><HEAD></HEAD><BODY>$arg</BODY></HTML>";
}
and then:
mysql_connect(blah, blah) || passAway('No! I shall avenge thine death, Ishmael');
>
>
>On a related note, do the sleep functions consume a lot of processor time,
>or is it very little?
>
>Where I'm going with this, I have a user login page where I'd like to add a
>delay after an unsuccessful attempt.
>The key being that you don't know if the attempt was successful or not
>until the response shows up.
>If I can make a hacker's task take longer, then I have a better chance of
>preventing his access.
>
>
>It's interesting that in PHP you are often concerned with how much load you
>are creating on the server, but I've never seen any mechanism to measure
>that load.
>--
>www.SpamWhack.com A pre-emptive strike against spam
>Where's dave?
>http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
>
>My transistor sings
>with unintended parasitic
>the smoke escapes
>
>By Jeff Stout
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
>For additional commands, e-mail: php-general-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
Send FREE Greetings for Father's Day--or any day!
Click here: http://www.whowhere.lycos.com/redirects/fathers_day.rdct