<?php
// --------------------------------------------------------------------------
//
// Esvon Classifieds v.4.0
// Copyright(C), Esvon LTD, 2001-2010, All Rights Reserved.
// E-mail: hide@address.com
//
// All forms of reproduction, including, but not limited to, internet posting,
// printing, e-mailing, faxing and recording are strictly prohibited.
// One license required per site running Esvon Classifieds.
// To obtain a license for using Esvon Classifieds, please register at
// http://www.esvon.com/pg/products/p_classifieds/
//
// --------------------------------------------------------------------------
if(!defined('SITE_PATH')) die('Access denied');
if($_POST['go']) ProcessFormAddList();
ShowFormAddList();
// sub area
function ShowFormAddList() {
$tpl_v = array(
'name' => '',
'descr' => '',
'bottom_text' => '',
);
if($_SERVER['REQUEST_METHOD']=='POST'){
foreach(array_keys($tpl_v) as $k) $tpl_v[$k] = html_esc($_POST[$k]);
}
if(!$tpl_v['bottom_text']) $tpl_v['bottom_text'] = 'To subscribe or unsubscribe via the World Wide Web, visit ##unsub_url##';
$tpl_v['hide'] = $tpl_v['hide'] ? 'checked' : '';
$tpl_v['capture'] = $tpl_v['capture'] ? 'checked' : '';
$tpl_v['id'] = '';
EvalAdvTpl(HW_MOD_TPL.'add_mlist.htm', $tpl_v, 1);
}
function ProcessFormAddList() {
global $db,$err_msg;
if(!$_POST['name']) $err_msg = 'Mailing list name cannot be empty';
if(!$err_msg) {
$db->query("INSERT INTO ".TBL_ML_IDX." (name,hide,capture,bottom_text,descr) VALUES (?,?,?,?,?)",
array($_POST['name'], $_POST['hide'], $_POST['capture'], $_POST['bottom_text'], $_POST['descr']) );
header('Location: '.HW_MOD_URL.'&file=indexm');
exit;
}
}
?>