errorlogging to file with formmail

i modified phpformmail a little bit, so you can have html logfiles on your server. 3 steps to do.

1. place the following line (with your correct absolute path and file) at the beginning of formmail.php:

$logfile="/absolute/filepath/here/existing-empty-errorfile.html";

2. make the logfile variable available in all functions using error_log with sth like global $logfile; right at the functions start.

3. replace the errologging directives: at the end of any line starting with

error_log

look for the end that looks like , 0);
replace it with , 3, $logfile);. be aware, at the end, andrews error log directives look a little different: there are no zeros.

that's all. all errors are being logged to your desired html-file. yes, i know, it's dirty, as it doesn't start / end with - but hell, who cares?

sorry, i don't post my code, as i'm using a heavily modified version of 1.07rc2

happy with that code? post some!

User login