我有这个问题:尝试制作管理面板,在那里我有用户的输入和 SMTP 帐户的传递,我需要在将其发送到数据库之前使其尽可能安全,我正在这样做:
$config = array(
'protocol' => 'smtp',
'smtp_host' => Settings_model::$db_config['smtp_host'],
'smtp_port' => Settings_model::$db_config['smtp_port'],
'smtp_user' => $this->encrypt->decode(Settings_model::$db_config['smtp_user']),
'smtp_pass' => $this->encrypt->decode(Settings_model::$db_config['smtp_pass']),
'smtp_timeout' => 30,
'charset' => "utf-8",
'newline' => "\r\n"
);
我得到了这个错误:
Fatal error: Using $this when not in object context in /application/helpers/send_email_helper.php on line 29
对于这一行:
'smtp_user' => $this->encrypt->decode(Settings_model::$db_config['smtp_user']),
'smtp_pass' => $this->encrypt->decode(Settings_model::$db_config['smtp_pass']),
有任何想法吗?我不想在文件中公开通行证和用户。提前致谢!