Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Email on error: What's wrong with my PHP code?
I’d like to the error page to send an email whenever it shows up.
I added:
<?php
$referrer = $_SERVER['HTTP_REFERRER'];
$url = $_SERVER['REQUEST_URI'];
$to = "ag@agux.co";
$subject = "Broken Link";
$message = $message = $referrer . "\r\n" . $url;
mail($to,$subject,$message,);
echo "Mail Sent.";
?>
It’s failing silently, so I’m not sure why Textpattern won’t send it. Any ideas?
{Edited to make the title match the topic. – Uli}
Last edited by uli (2013-01-11 22:38:38)
Offline
#2 2013-01-07 22:26:54
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: Email on error: What's wrong with my PHP code?
Probably no need to reinvent the wheel: There’s wan_error_email. Can’t tell whether it’s still working, but that’s tried quickly.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: Email on error: What's wrong with my PHP code?
mail($to,$subject,$message,);
will produce a Parse error: syntax error, unexpected ')'
.
Offline