TechAsh
Retired
- Messages
- 5,853
- Reaction score
- 7
- Points
- 38
I'm having problems with a PHP backup script I use. It is run daily via a cron job, and it's job is to create a gzip backup of my databases, then save it on the server and also e-mail me a copy.
The error I'm getting is:
Here is the contents of 'phpmysqlautobackup_extras.php':
Please can someone tell me what to do to make it work.
P.S. It was working fine up till 3rd March, and I don't think I have changed anything near that line to make it stop working.
The error I'm getting is:
ALERT - function within blacklist called: mail() (attacker 'REMOTE_ADDR not set', file '/home/techash/backups/mysql/files/phpmysqlautobackup_extras.php', line 22)
Here is the contents of 'phpmysqlautobackup_extras.php':
PHP:
<?php
$phpMySQLAutoBackup_version="1.4.0";
function has_data($value)
{
if (is_array($value)) return (sizeof($value) > 0)? true : false;
else return (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) ? true : false;
}
function xmail ($to_emailaddress,$from_emailaddress, $subject, $content, $file_name, $backup_type)
{
$mail_attached = "";
$boundary = "----=_NextPart_000_01FB_010".md5($to_emailaddress);
$mail_attached.="--".$boundary."\n"
."Content-Type: application/octet-stream;\n name=\"$file_name\"\n"
."Content-Transfer-Encoding: base64\n"
."Content-Disposition: attachment; \n filename=\"$file_name\"\n\n"
.chunk_split(base64_encode($content))."\n";
$mail_attached .= "--".$boundary."--\n";
$add_header ="MIME-Version: 1.0\nContent-Type: multipart/mixed;\n boundary=\"$boundary\" \n\n";
$mail_content="--".$boundary."\n"."Content-Type: text/plain; \n charset=\"iso-8859-1\"\n"."Content-Transfer-Encoding: 7bit\n\nMySQL BACKUP Successful...\n\nPlease see attached for your zipped Backup file; $backup_type \n".$mail_attached;
return mail($to_emailaddress, $subject, $mail_content, "From: $from_emailaddress\nReply-To:$from_emailaddress\n".$add_header);
}
function write_backup($gzdata, $backup_file_name)
{
$fp = fopen(LOCATION."../backups/".$backup_file_name, "w");
fwrite($fp, $gzdata);
fclose($fp);
}
?>
Please can someone tell me what to do to make it work.
P.S. It was working fine up till 3rd March, and I don't think I have changed anything near that line to make it stop working.