I don't know where to post this message PHP or PERL.
I have a script in PERL and, as I don't know if it is possible in PERL, I would want to include a PHP script which mail me as soon as a fault arrives on my site.
I don't want to use "sendmail" ou "formail", just a littel script which mail me.
The result should be:
#!/usr/bin/perl --
# follow the PERL code
# Below, the PHP code
$adr_expediteur = 'error404@mydomain.net';
$to="webmaster@mydomain.net";
$sujet="ERROR 404 on the website.";
if(empty($HTTP_REFERER)) { $provenance="direct link"; } else { $provenance=$HTTP_REFERER; }
$message="\nError 404\n\nProvenance : ".$provenance.";
Page : ".$SCRIPT_URI."\nNavigateur : $HTTP_USER_AGENT\nAdress IP : [$REMOTE_ADDR\nDomain...] name: ".gethostbyaddr($REMOTE_ADDR)."\n";
@mail($to,$sujet,$message, "From: $adr_expediteur");
# End PHP code
exit;
Is it possible or is there an other way to complete this script?
Thank you for your help.