"Contact", 2=>"Comment or Advice", 3=>"I like to send News or Article", 4=>"Advertise / Event", 5=>"Link error"); for ($i = 1; $i <= 5; $i++) $emails[$i] = ($email_contact != '') ? $email_contact : "haber@kpdailynews.com"; /* contact form */ $ok = false; if (is_array($_POST['c'])) { $ok = contact_send($_POST['c']); } if (!$ok) { $tpl->set($_POST['c']); $tpl->set("section", make_select($sections, $_POST['c']['section'], "-- Please choice from drop down menu --")); $tpl->set("vcode_md5", make_code()); $tpl->parse("contact_form", "form"); } else { $tpl->parse("contact_sent", "form"); } $tpl->parse("main", "main"); function contact_send(&$c) { global $tpl, $emails; $ok = true; if (!check_code($c['vcode'], $_POST['vcode_md5'])) { $tpl->set('err_vcode', "Please enter the code"); $ok = false; } if (!$c['section'] || $emails[$c['section']] == '') { $tpl->set("err_section", "Please choice one of the option"); $ok = false; } foreach (array("name", "surname", "msg") as $k) if (trim($c[$k]) == '') { $tpl->set("err_$k", "Please fill the space"); $ok = false; } if (!preg_match("/^[A-Za-z0-9_.+]+\@[A-Za-z0-9.-]+$/", $c['email'])) { $tpl->set("err_email", "Please use valid email address"); $ok = false; } if ($ok) { $s = <<"); if (!$ok) $tpl->parse("contact_err", "contact_err"); } return $ok; } ?> CYPRUS MIRROR Daily News | About Us