Hi Stephen,
>How do I code a PHP program
>to send mail from the server based on info from the form or in case
>the MySQL daemon is down. Any assistance would be great.
How about this (not checked, just the general idea):
$alertaddr = "tomalock@stripped";
$from = "php@yourdomain";
if (mysql_ping($db)) {
$body = mysql_error();
mail($alertaddr, "MySQL error", $body,
"From: $from\nReturn-Path: <$from>");
echo "<b>".mysql_error()."</b>";
exit;
}
Stan
--
Stan P. van de Burgt stan@stripped (0x853296C5)
DMO, P.O. box 1248, 3500 AE, Utrecht, the Netherlands
| Thread |
|---|
| • Former mSQL user | Stephen Johnson | 15 Apr |
| • Re: Former mSQL user | Stan P. van de Burgt | 15 Apr |