Hey All,
I just found this site and I’m enjoying it already.
I have an issue that I can’t seem to track down and thought maybe someone could assist me with.
I have a member based script that needs to occasionally send out some email to all or select members through a web form in the admin area.
The php grabs the form data updates the mysql db with certain parameters such as who gets the email, the subject and message, then executes a file on the site called emailer.sys.php to actually run the email function and send out mail.
The code looks like such:
[php]
function ocd_send ()
{
$status = $this->GetGP (“status”);
$subject = $this->enc ($this->GetValidGP (“subject”, “subject”, VALIDATE_NOT_EMPTY));
$message = $this->enc ($this->GetValidGP (“message”, “Message”, VALIDATE_NOT_EMPTY));
$saveSettings = $this->GetGP (“saveSettings”, 0);
if ($this->errors['err_count'] > 0)
{
$this->ocd_list ("send");
}
else
{
$this->db->ExecuteSql ("Update settings Set value='$status' Where keyname='SendMailStatus'");
$this->db->ExecuteSql ("Update settings Set value='$subject' Where keyname='SendMailSubject'");
$this->db->ExecuteSql ("Update settings Set value='$message' Where keyname='SendMailMessage'");
if ($saveSettings == 1)
{
$this->db->ExecuteSql ("Update settings Set value='$status' Where keyname='SendMailStatusDefault'");
$this->db->ExecuteSql ("Update settings Set value='$subject' Where keyname='SendMailSubjectDefault'");
$this->db->ExecuteSql ("Update settings Set value='$message' Where keyname='SendMailMessageDefault'");
}
$appRoot = "/home/myaccount/public_html";
$path = "/usr/bin/php";
session_write_close ();
exec ("/usr/bin/php /home/myaccount/public_html/admin/emailer.sys.php > /dev/null 2>&1", $retval);
session_start ();
$this->Redirect ($this->pageUrl."?ec=sent");
}
}
[/php]
I just recently switched hosts and suddenly this function will not work.
It produces NO errors whatsoever in any server logs, nor does it print any errors to the page. It simply doesn’t run the file.
If I run the file manually by calling emailer.sys.php in a browser it runs no problem, but it won’t fire via the script above.
Anyone have any ideas?
Thanks.
Josh