/**
  * The SpamFilter class instantiation function.
  *
  * @return SpamFilter
  */
 function SpamFilter()
 {
     // constructor
     // setup default options
     setOptionDefault('Forgiving', 0);
     setOptionDefault('SpamAssassin_host', 'localhost');
     setOptionDefault('SpamAssassin_ctype', 'tcp');
     setOptionDefault('SpamAssassin_port', '');
     setOptionDefault('SpamAssassin_socket', '');
     setOptionDefault('SpamAssassin_user', '');
     /* Spamassassin variables */
     $this->spamassassin_host = getOption('SpamAssassin_host');
     $this->spamassassin_ctype = getOption('SpamAssassin_ctype');
     if ($this->spamassassin_ctype == 'tcp') {
         $this->spamassassin_port = getOption('SpamAssassin_port');
     } else {
         $this->spamassassin_socket = getOption('SpamAssassin_socket');
     }
     $this->spamassassin_user = getOption('SpamAssassin_user');
     /* Internal variables I need to fetch to use them in the class */
     $this->server_name = php_uname('n');
     $admin_emails = getAdminEmail();
     if (count($admin_emails) > 0) {
         $this->admin_email = $admin_emails[0];
     }
 }
          <tr>
			<th width="12%"> Date </th>
            <th width="15%"> Training Category </th>
            <th width="23%"> Title</th>
			<th width="23%"> Trainer Email</th>
            <th width="40%"> Brief Description</th>
            <th width="19%"> Contact</th>
          </tr>
        </thead>   
          <tbody>
        <?php 
/*..............................Further Training List....................................*/
$user_interest = getUserInterest($conn, $registration_id);
$result1 = $conn->query("SELECT * FROM `job_training_list` WHERE admin_id!=0 and status=1");
while ($row1 = $result1->fetch_assoc()) {
    $mail = getAdminEmail($conn, $row1['admin_id']);
    $post_date = $row1['post_date'];
    $date = date('d-m-Y', strtotime($post_date));
    ?>
          <tr>
			<td data-title="Date"><?php 
    echo $date;
    ?>
</td>
            <td data-title="Training Category"><?php 
    echo getInterest($conn, $row1['area_of_interest']);
    ?>
</td>
            <td data-title="Name of the Program"><?php 
    echo $row1['title'];
    ?>
Example #3
0
/**
 * Send an mail to the admin user(s). We also attempt to intercept any form injection
 * attacks by slime ball spammers.
 *
 * @param string $subject  The subject of the email.
 * @param string $message  The message contents of the email.
 * @param string $headers  Optional headers for the email.
 * @param array $admin_emails a list of email addresses
 *
 * @author Todd Papaioannou (lucky@luckyspin.org)
 * @since  1.0.0
 */
function zp_mail($subject, $message, $headers = '', $admin_emails = null)
{
    global $_zp_UTF8;
    if (is_null($admin_emails)) {
        $admin_emails = getAdminEmail();
    }
    if (count($admin_emails) > 0) {
        // Make sure no one is trying to use our forms to send Spam
        // Stolen from Hosting Place:
        //   http://support.hostingplace.co.uk/knowledgebase.php?action=displayarticle&cat=0000000039&id=0000000040
        $badStrings = array("Content-Type:", "MIME-Version:", "Content-Transfer-Encoding:", "bcc:", "cc:");
        foreach ($_POST as $k => $v) {
            foreach ($badStrings as $v2) {
                if (strpos($v, $v2) !== false) {
                    header("HTTP/1.0 403 Forbidden");
                    die("Forbidden");
                    exit;
                }
            }
        }
        foreach ($_GET as $k => $v) {
            foreach ($badStrings as $v2) {
                if (strpos($v, $v2) !== false) {
                    header("HTTP/1.0 403 Forbidden");
                    die("Forbidden");
                    exit;
                }
            }
        }
        if ($headers == '') {
            $headers = "From: " . get_language_string(getOption('gallery_title'), getOption('locale')) . "<zenphoto@" . $_SERVER['SERVER_NAME'] . ">";
        }
        // Convert to UTF-8
        if (getOption('charset') != 'UTF-8') {
            $subject = $_zp_UTF8->convert($subject, getOption('charset'));
            $message = $_zp_UTF8->convert($message, getOption('charset'));
        }
        // Send the mail
        foreach ($admin_emails as $email) {
            $_zp_UTF8->send_mail($email, $subject, $message, $headers);
        }
    }
}
// +----------------------------------------------------------------------+
// | Copyrights Armia Systems, Inc and iScripts.com © 2005                |
// | All rights reserved                                                  |
// +----------------------------------------------------------------------+
// | This script may not be distributed, sold, given away for free to     |
// | third party, or used as a part of any internet services such as      |
// | webdesign etc.                                                       |
// +----------------------------------------------------------------------+
include "includes/config.php";
include "includes/session.php";
include "includes/functions.php";
/*display the active template*/
$active_template = displayTemplate();
// setting pagination limit From Admin settings
$limit = getPaginationLimit();
$admin_email = getAdminEmail();
if ($limit == 0) {
    $limit = 10;
}
$page = $_GET['page'];
if (empty($page)) {
    $page = 1;
}
//End pagination settings
//include "includes/htmltop.php";
if (!isset($_SERVER['REQUEST_URI'])) {
    if (isset($_SERVER['SCRIPT_NAME'])) {
        $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'];
    } else {
        $_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'];
    }
/**
 * Print the login form for ZP. This will take into account whether mod_rewrite is enabled or not.
 *
 * @param string $redirect URL to return to after login
 * @param bool $logo set to true to display the ADMIN zenphoto logo.
 *
 * @author Todd Papaioannou (lucky@luckyspin.org)
 * @since  1.0.0
 */
function printLoginForm($redirect = null, $logo = true)
{
    global $_zp_login_error, $_zp_captcha;
    if (is_null($redirect)) {
        $redirect = "/" . ZENFOLDER . "/admin.php";
    }
    if (isset($_POST['user'])) {
        $requestor = sanitize($_POST['user'], 3);
    } else {
        $requestor = '';
    }
    if (empty($requestor)) {
        if (isset($_GET['ref'])) {
            $requestor = sanitize($_GET['ref'], 0);
        }
    }
    if ($logo) {
        echo "<p><img src=\"../" . ZENFOLDER . "/images/zen-logo.gif\" title=\"Zen Photo\" /></p>";
    }
    if (count(getAdminEmail()) > 0) {
        $star = '*';
    } else {
        $star = '&nbsp;';
    }
    echo "\n  <div id=\"loginform\">";
    if ($_zp_login_error == 1) {
        echo "<div class=\"errorbox\" id=\"message\"><h2>" . gettext("There was an error logging in.") . "</h2> " . gettext("Check your username and password and try again.") . "</div>";
    } else {
        if ($_zp_login_error == 2) {
            echo '<div class="messagebox" id="fade-message">';
            echo "<h2>" . gettext("A reset request has been sent.") . "</h2>";
            echo '</div>';
        }
    }
    echo "\n  <form name=\"login\" action=\"#\" method=\"POST\">";
    echo "\n\t <input type=\"hidden\" name=\"login\" value=\"1\" />";
    echo "\n\t <input type=\"hidden\" name=\"redirect\" value=\"{$redirect}\" />";
    echo "\n\t <table>";
    echo "\n\t\t<tr><td align=\"right\"><h2>" . gettext("Login") . '&nbsp;' . "</h2></td><td><input class=\"textfield\" name=\"user\" type=\"text\" size=\"20\" value=\"{$requestor}\" /></td></tr>";
    echo "\n\t\t<tr><td align=\"right\"><h2>" . gettext("Password") . $star . "</h2></td><td><input class=\"textfield\" name=\"pass\" type=\"password\" size=\"20\" /></td></tr>";
    if ($star == '*') {
        $captchaCode = $_zp_captcha->generateCaptcha($img);
        $html = "<input type=\"hidden\" name=\"code_h\" value=\"" . $captchaCode . "\"/><label for=\"code\"><img src=\"" . $img . "\" alt=\"Code\" align=\"bottom\"/></label>";
        echo "\n\t\t<tr><td colspan=\"2\">";
        echo "\n\t\t" . sprintf(gettext("*Enter %s to email a password reset."), $html);
        echo "\t\t</td></tr>";
    }
    echo "\n\t\t<tr><td></td><td colspan=\"2\"><input class=\"button\" type=\"submit\" value=\"" . gettext("Log in") . "\" /></td></tr>";
    echo "\n\t </table>";
    echo "\n  </form>";
    echo "\n  </div>";
    echo "\n</body>";
    echo "\n</html>";
}