Location: PHPKode > projects > Esvon Personals > esvon-personals/inc/pages/feedback.php
<?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');

$EN_IMG_VER = 1;

// main code

// is GD library present ?
if(!GD_VER) $EN_IMG_VER = 0;

if($_GET['mode']=='image'){ // deprecated
  if($EN_IMG_VER) {
    $o_iv =& Factory::create('Image_Verify');
    $o_iv->DisplayImage();
  }
  exit;
}

 $whitelist = array(
   'name' => array(
     'type' => 'string',
     'maxlength' => 100,
   ),
   'email' => array(
     'type' => 'email',
     'maxlength' => 100,
   ),
   'url' => array(
     'type' => 'string',
     'maxlength' => 100,
   ),
   'foundus' => array(
     'type' => 'string',
     'maxlength' => 100,
   ),
   'comments' => array(
     'type' => 'string',
     'maxlength' => 1000,
   ),
 );

$err_msg = '';
$tpl_v = array();
$tpl_v['EN_IMG_VER'] = $EN_IMG_VER;

if($_SERVER['REQUEST_METHOD']=='POST') {

  $clean = esFilter($_POST, $whitelist);

  if(!$clean['email']) $err_msg = hwLng('req_email');
  elseif(!$clean['comments']){ 
    if($_POST['comments']) $clean['comments'] = substr($_POST['comments'],0,1000); // foreign chars issues
    else $err_msg = hwLng('req_comments');
  }

  if(!$err_msg && $EN_IMG_VER){
    $o_iv =& Factory::create('Image_Verify');
    if(!$o_iv->IsTextOK($_POST['img_text'])) $err_msg = hwLng('err_img_code');
  }

  if(!$err_msg){

    foreach(array_keys($whitelist) as $k) $tpl_v[$k] = html_esc($clean[$k]);

    EvalAdvTpl(TPL_PATH.'feedback_ok.htm', $tpl_v, 1);

    $tpl_v['HTTP_REFERER'] = html_esc($_SERVER['HTTP_REFERER']);
    $email_body = EvalAdvTpl(TPL_PATH.'feedback.mail',$tpl_v);

    hwSendMail(ADMIN_EMAIL, $tpl_v['email'], '', $email_body);

    return;
  }
  
} //end POST

foreach(array_keys($whitelist) as $k) $tpl_v[$k] = isset($_POST[$k]) ? html_esc($_POST[$k]) : '';
$tpl_v['err_msg'] = $err_msg;

EvalAdvTpl(TPL_PATH.'feedback.htm', $tpl_v, 1);

?>
Return current item: Esvon Personals