%PDF- %PDF-
Direktori : /home/nailstv/public_html/es.nails.tv/ |
Current File : /home/nailstv/public_html/es.nails.tv/_saveAkademia.php |
<?php header('Content-Type: text/html; charset=utf-8'); require_once 'config/config.php'; error_reporting(0); ini_set('display_errors',0); Registry::set('debug',false); /* REF TYPE ============== 1 SMS 2 hírlevél 3 mukorom.hu 4 cn.hu 5 fb 6 egyéb */ $name = isset($_REQUEST['name']) ? $_REQUEST['name']: null; $email = isset($_REQUEST['email']) ? $_REQUEST['email']: null; $type = isset($_REQUEST['type']) ? $_REQUEST['type']: 1; $ref = isset($_REQUEST['ref']) ? $_REQUEST['ref']: null; $response = array( 'message' => '' ); $db = Db::getInstance(); if(!$name) $response['message'] .= 'Név megadása kötelező! <br />'; if(!$email) $response['message'] .= 'E-mail megadása kötelező! <br />'; if(!$ref) $response['message'] .= 'Forrás megadása kötelező! <br />'; if (!filter_var($email, FILTER_VALIDATE_EMAIL)) $response['message'] .= 'E-mail formátuma nem helyes! <br />'; $bind = array($name, $email, $type, $ref); if(!empty($response['message'])) { $response['status'] = -1; die(json_encode($response)); } $sql = "INSERT INTO `akademia_stat` (`id`, `name`, `email`, `type`, `ref`) VALUES (NULL, '".mysql_escape_string($name)."', '".mysql_escape_string($email)."', '".intval($type)."', '".intval($ref)."');"; $db->Execute($sql); $response = array( 'status' => 1, 'message' => 'ok' ); die(json_encode($response));