本文整理汇总了PHP中prepare_input函数的典型用法代码示例。如果您正苦于以下问题:PHP prepare_input函数的具体用法?PHP prepare_input怎么用?PHP prepare_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了prepare_input函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$this->ipAddressBlocked = false;
$this->emailBlocked = false;
$this->loginError = '';
$submit_login = isset($_POST['submit_login']) ? prepare_input($_POST['submit_login']) : '';
$submit_logout = isset($_POST['submit_logout']) ? prepare_input($_POST['submit_logout']) : '';
$user_name = isset($_POST['user_name']) ? prepare_input($_POST['user_name'], true) : '';
$password = isset($_POST['password']) ? prepare_input($_POST['password'], true) : '';
$this->accountType = isset($_POST['type']) ? prepare_input($_POST['type']) : 'customer';
$remember_me = isset($_POST['remember_me']) ? prepare_input($_POST['remember_me']) : '';
$this->wrongLogin = false;
if (!$this->IsLoggedIn()) {
if ($submit_login == 'login') {
if (empty($user_name) || empty($password)) {
if (isset($_POST['user_name']) && empty($user_name)) {
$this->loginError = '_USERNAME_EMPTY_ALERT';
} else {
if (isset($_POST['password']) && empty($password)) {
$this->loginError = '_WRONG_LOGIN';
}
}
$this->wrongLogin = true;
} else {
$this->DoLogin($user_name, $password, $remember_me);
}
}
} else {
if ($submit_logout == 'logout') {
$this->DoLogout();
}
}
$this->activeMenuCount = 0;
}
示例2: __construct
function __construct($id = '')
{
$this->id = $id;
$this->languageId = isset($_REQUEST['language_id']) && $_REQUEST['language_id'] != '' ? prepare_input($_REQUEST['language_id']) : Languages::GetDefaultLang();
$this->whereClause = '';
$this->whereClause .= $this->languageId != '' ? ' AND language_id = \'' . $this->languageId . '\'' : '';
$this->langIdByUrl = $this->languageId != '' ? '&language_id=' . $this->languageId : '';
if ($this->id != '') {
$sql = 'SELECT
' . TABLE_MENUS . '.*,
' . TABLE_LANGUAGES . '.lang_name as language_name
FROM ' . TABLE_MENUS . '
LEFT OUTER JOIN ' . TABLE_LANGUAGES . ' ON ' . TABLE_MENUS . '.language_id = ' . TABLE_LANGUAGES . '.abbreviation
WHERE ' . TABLE_MENUS . '.id = \'' . (int) $this->id . '\'';
$this->menu = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY);
} else {
$this->menu['menu_name'] = '';
$this->menu['menu_placement'] = '';
$this->menu['menu_order'] = '';
$this->menu['language_id'] = '';
$this->menu['language_name'] = '';
$this->menu['access_level'] = '';
}
}
示例3: __construct
function __construct()
{
// get filter value
$this->filterBy = isset($_REQUEST['filter_by']) ? prepare_input($_REQUEST['filter_by']) : '';
$this->filterByUrl = $this->filterBy != '' ? '&filter_by=' . $this->filterBy : '';
$this->languageId = isset($_REQUEST['language_id']) && $_REQUEST['language_id'] != '' ? prepare_input($_REQUEST['language_id']) : Languages::GetDefaultLang();
$this->langIdByUrl = $this->languageId != '' ? '&language_id=' . $this->languageId : '';
$this->whereClause = '';
$this->whereClause .= $this->languageId != '' ? ' AND language_id = \'' . $this->languageId . '\'' : '';
$this->whereClause .= $this->filterBy != '' ? ' AND key_value LIKE \'_' . $this->filterBy . '%\'' : '';
$this->isKeyUpdated = false;
$this->vocabularySize = 0;
$this->currentKey = '';
$this->updatedKeys = '0';
}
示例4: prepare_input
function prepare_input(&$var)
{
if (is_array($var)) {
foreach ($var as $key => $value) {
prepare_input($var[$key]);
}
} else {
if (get_magic_quotes_gpc()) {
$var = stripslashes($var);
}
$var = str_replace("\r\n", "\n", $var);
//windows linefeeds
$var = str_replace("\r", "\n", $var);
//mac linefeeds
}
}
示例5: __construct
function __construct($login_type = '')
{
parent::__construct();
global $objSettings;
$this->params = array();
if (isset($_POST['first_name'])) {
$this->params['first_name'] = prepare_input($_POST['first_name']);
}
if (isset($_POST['last_name'])) {
$this->params['last_name'] = prepare_input($_POST['last_name']);
}
if (isset($_POST['user_name'])) {
$this->params['user_name'] = prepare_input($_POST['user_name']);
}
if (isset($_POST['password'])) {
$this->params['password'] = prepare_input($_POST['password']);
}
if (isset($_POST['email'])) {
$this->params['email'] = prepare_input($_POST['email']);
}
if (isset($_POST['preferred_language'])) {
$this->params['preferred_language'] = prepare_input($_POST['preferred_language']);
}
if (isset($_POST['account_type'])) {
$this->params['account_type'] = prepare_input($_POST['account_type']);
}
if (isset($_POST['date_created'])) {
$this->params['date_created'] = prepare_input($_POST['date_created']);
}
if (isset($_POST['is_active'])) {
$this->params['is_active'] = (int) $_POST['is_active'];
} else {
$this->params['is_active'] = '0';
}
if (self::$PROJECT == 'HotelSite') {
if (isset($_POST['hotels'])) {
$this->params['hotels'] = prepare_input($_POST['hotels']);
}
}
$this->primaryKey = 'id';
$this->tableName = TABLE_ACCOUNTS;
$this->dataSet = array();
$this->error = '';
$this->formActionURL = 'index.php?admin=admins_management';
$this->actions = array('add' => true, 'edit' => true, 'details' => true, 'delete' => true);
$this->actionIcons = true;
$this->allowRefresh = true;
$this->allowLanguages = false;
if ($login_type == 'owner') {
$this->WHERE_CLAUSE = 'WHERE (' . TABLE_ACCOUNTS . '.account_type = \'mainadmin\' || ' . TABLE_ACCOUNTS . '.account_type = \'admin\' || ' . TABLE_ACCOUNTS . '.account_type = \'hotelowner\')';
} else {
if ($login_type == 'mainadmin') {
$this->WHERE_CLAUSE = 'WHERE (' . TABLE_ACCOUNTS . '.account_type = \'admin\' || ' . TABLE_ACCOUNTS . '.account_type = \'hotelowner\')';
} else {
if ($login_type == 'admin') {
$this->WHERE_CLAUSE = 'WHERE ' . TABLE_ACCOUNTS . '.account_type = \'admin\'';
} else {
if ($login_type == 'hotelowner') {
$this->WHERE_CLAUSE = 'WHERE ' . TABLE_ACCOUNTS . '.account_type = \'hotelowner\'';
}
}
}
}
$this->ORDER_CLAUSE = 'ORDER BY id ASC';
$this->isAlterColorsAllowed = true;
$this->isPagingAllowed = true;
$this->pageSize = 20;
$this->isSortingAllowed = true;
$this->isFilteringAllowed = true;
// define filtering fields
$this->arrFilteringFields = array(_FIRST_NAME => array('table' => $this->tableName, 'field' => 'first_name', 'type' => 'text', 'sign' => 'like%', 'width' => '80px'), _LAST_NAME => array('table' => $this->tableName, 'field' => 'last_name', 'type' => 'text', 'sign' => 'like%', 'width' => '80px'), _ACTIVE => array('table' => $this->tableName, 'field' => 'is_active', 'type' => 'dropdownlist', 'source' => array('0' => _NO, '1' => _YES), 'sign' => '=', 'width' => '85px'));
// prepare languages array
$total_languages = Languages::GetAllActive();
$arr_languages = array();
foreach ($total_languages[0] as $key => $val) {
$arr_languages[$val['abbreviation']] = $val['lang_name'];
}
$arr_account_types = array('admin' => _ADMIN, 'mainadmin' => _MAIN_ADMIN);
if (self::$PROJECT == 'HotelSite') {
$arr_account_types['hotelowner'] = _HOTEL_OWNER;
}
$arr_is_active = array('0' => '<span class=no>' . _NO . '</span>', '1' => '<span class=yes>' . _YES . '</span>');
$datetime_format = get_datetime_format();
if (self::$PROJECT == 'HotelSite') {
$total_hotels = Hotels::GetAllActive();
$arr_hotels = array();
foreach ($total_hotels[0] as $key => $val) {
$this->arrCompanies[$val['id']] = $val['name'];
}
$this->additionalFields = ', hotels';
$this->accountTypeOnChange = 'onchange="javascript:AccountType_OnChange(this.value)"';
}
if ($objSettings->GetParameter('date_format') == 'mm/dd/yyyy') {
$this->sqlFieldDatetimeFormat = '%b %d, %Y %H:%i';
} else {
$this->sqlFieldDatetimeFormat = '%d %b, %Y %H:%i';
}
$this->SetLocale(Application::Get('lc_time_name'));
//----------------------------------------------------------------------
// VIEW MODE
//.........这里部分代码省略.........
示例6: __construct
function __construct()
{
parent::__construct();
$this->params = array();
## for standard fields
if (isset($_POST['name'])) {
$this->params['name'] = prepare_input($_POST['name']);
}
if (isset($_POST['is_active'])) {
$this->params['is_active'] = (int) $_POST['is_active'];
}
// $this->params['language_id'] = MicroGrid::GetParameter('language_id');
$this->primaryKey = 'id';
$this->tableName = TABLE_LISTINGS_LOCATIONS;
$this->dataSet = array();
$this->error = '';
$this->formActionURL = 'index.php?admin=mod_listings_locations';
$this->actions = array('add' => true, 'edit' => true, 'details' => true, 'delete' => true);
$this->actionIcons = true;
$this->allowRefresh = true;
$this->allowLanguages = false;
//$this->languageId = ($this->params['language_id'] != '') ? $this->params['language_id'] : Languages::GetDefaultLang();
$this->WHERE_CLAUSE = '';
// WHERE .... / 'WHERE language_id = \''.$this->languageId.'\'';
$this->ORDER_CLAUSE = 'ORDER BY name ASC';
// ORDER BY '.$this->tableName.'.date_created DESC
$this->isAlterColorsAllowed = true;
$this->isPagingAllowed = true;
$this->pageSize = 30;
$this->isSortingAllowed = true;
$this->isFilteringAllowed = true;
$arr_default_types = array('0' => _NO, '1' => _YES);
$arr_activity_types = array('0' => _NO, '1' => _YES);
// define filtering fields
$this->arrFilteringFields = array(_NAME => array('table' => $this->tableName, 'field' => 'name', 'type' => 'text', 'sign' => 'like%', 'width' => '100px'), _ACTIVE => array('table' => $this->tableName, 'field' => 'is_active', 'type' => 'dropdownlist', 'source' => $arr_activity_types, 'sign' => '=', 'width' => '90px', 'visible' => true));
//----------------------------------------------------------------------
// VIEW MODE
//----------------------------------------------------------------------
$this->VIEW_MODE_SQL = 'SELECT ' . $this->primaryKey . ',
name,
CONCAT("<a href=index.php?admin=mod_listings_sub_locations&lid=", ' . $this->tableName . '.' . $this->primaryKey . ',
">[ ", "' . _SUB_LOCATIONS . ' ]</a> (",
(SELECT COUNT(*) FROM ' . TABLE_LISTINGS_SUB_LOCATIONS . ' sl WHERE sl.location_id = ' . $this->tableName . '.' . $this->primaryKey . '),
")") as link_sub_locations,
IF(is_active, \'<span class=yes>' . _YES . '</span>\', \'<span class=no>' . _NO . '</span>\') as mod_is_active
FROM ' . $this->tableName;
// define view mode fields
$this->arrViewModeFields = array('name' => array('title' => _NAME, 'type' => 'label', 'align' => 'left', 'width' => '', 'height' => '', 'maxlength' => ''), 'mod_is_active' => array('title' => _ACTIVE, 'type' => 'label', 'align' => 'center', 'width' => '110px', 'height' => '', 'maxlength' => ''), 'link_sub_locations' => array('title' => '', 'type' => 'label', 'align' => 'left', 'width' => '160px', 'maxlength' => '', 'visible' => true));
//----------------------------------------------------------------------
// ADD MODE
// Validation Type: alpha|numeric|float|alpha_numeric|text|email
// Validation Sub-Type: positive (for numeric and float)
// Ex.: 'validation_type'=>'numeric', 'validation_type'=>'numeric|positive'
//----------------------------------------------------------------------
// define add mode fields
$this->arrAddModeFields = array('name' => array('title' => _NAME, 'type' => 'textbox', 'width' => '210px', 'required' => true, 'readonly' => false, 'maxlength' => '50', 'default' => '', 'validation_type' => 'text'), 'is_active' => array('title' => _ACTIVE, 'type' => 'enum', 'required' => true, 'width' => '90px', 'readonly' => false, 'default' => '1', 'source' => $arr_activity_types, 'unique' => false, 'javascript_event' => ''));
//----------------------------------------------------------------------
// EDIT MODE
// Validation Type: alpha|numeric|float|alpha_numeric|text|email
// Validation Sub-Type: positive (for numeric and float)
// Ex.: 'validation_type'=>'numeric', 'validation_type'=>'numeric|positive'
//----------------------------------------------------------------------
$this->EDIT_MODE_SQL = 'SELECT
' . $this->tableName . '.' . $this->primaryKey . ',
' . $this->tableName . '.name,
' . $this->tableName . '.is_active,
IF(is_active, \'<span class=yes>' . _YES . '</span>\', \'<span class=no>' . _NO . '</span>\') as mod_is_active
FROM ' . $this->tableName . '
WHERE ' . $this->tableName . '.' . $this->primaryKey . ' = _RID_';
// define edit mode fields
$this->arrEditModeFields = array('name' => array('title' => _NAME, 'type' => 'textbox', 'width' => '210px', 'required' => true, 'readonly' => false, 'maxlength' => '50', 'default' => '', 'validation_type' => 'text'), 'is_active' => array('title' => _ACTIVE, 'type' => 'enum', 'required' => true, 'width' => '90px', 'readonly' => false, 'default' => '1', 'source' => $arr_activity_types, 'unique' => false, 'javascript_event' => ''));
//----------------------------------------------------------------------
// DETAILS MODE
//----------------------------------------------------------------------
$this->DETAILS_MODE_SQL = $this->EDIT_MODE_SQL;
$this->arrDetailsModeFields = array('name' => array('title' => _NAME, 'type' => 'label'), 'mod_is_active' => array('title' => _ACTIVE, 'type' => 'label'));
}
示例7: defined
<?php
/**
* @project ApPHP Business Directory
* @copyright (c) 2011 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
$mg_language_id = isset($_REQUEST['mg_language_id']) ? prepare_input($_REQUEST['mg_language_id']) : Application::Get('lang');
if ($objLogin->IsLoggedInAsAdmin()) {
$objPage = new Pages(Application::Get('page_id'), false, $mg_language_id);
} else {
$objPage = new Pages(Application::Get('system_page') != '' ? Application::Get('system_page') : Application::Get('page_id'), true, $mg_language_id);
}
$button_text = '';
// check if there is a page
if ($objSession->IsMessage('notice')) {
draw_title_bar(_PAGE);
echo $objSession->GetMessage('notice');
} else {
if ($objPage->CheckAccessRights($objLogin->IsLoggedIn())) {
// check if there is a page
if ($objPage->GetId() != '') {
if ($objLogin->IsLoggedInAsAdmin() && Application::Get('preview') != 'yes') {
$button_text = prepare_permanent_link('index.php?admin=pages' . (Application::Get('type') == 'system' ? '&type=system' : '') . '&mg_language_id=' . $mg_language_id, _BUTTON_BACK);
}
$objPage->DrawTitle($button_text);
if (Modules::IsModuleInstalled('adsense') && (ModulesSettings::Get('adsense', 'adsense_code_activation') == 'All' || ModulesSettings::Get('adsense', 'adsense_code_activation') == 'Horizontal')) {
示例8: defined
<?php
/**
* @project ApPHP Business Directory
* @copyright (c) 2012 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
$act = isset($_POST['act']) ? prepare_input($_POST['act']) : '';
$password_sent = (bool) Session::Get('activation_email_resent');
$email = isset($_POST['email']) ? prepare_input($_POST['email']) : '';
$msg = '';
if ($act == 'resend') {
if (!$password_sent) {
if (Customers::Reactivate($email)) {
$msg = draw_success_message(str_replace('_EMAIL_', $email, _ACTIVATION_EMAIL_WAS_SENT), false);
Session::Set('activation_email_resent', true);
} else {
$msg = draw_important_message(Customers::GetStaticError(), false);
}
} else {
$msg = draw_message(_ACTIVATION_EMAIL_ALREADY_SENT, false);
}
}
// Draw title bar
draw_title_bar(_RESEND_ACTIVATION_EMAIL);
// Check if customer is logged in
if (!$objLogin->IsLoggedIn() && ModulesSettings::Get('customers', 'allow_registration') == 'yes') {
示例9: prepare_input
if (!empty($_POST) && isset($_POST['shippay'])) {
$email_info = prepare_input($_POST['email_info']);
$phone = prepare_input($_POST['phone']);
$ship_address1 = prepare_input($_POST['ship_address1']);
$ship_address2 = prepare_input($_POST['ship_address2']);
$ship_city = prepare_input($_POST['ship_city']);
$ship_state = prepare_input($_POST['ship_state']);
$ship_postalcode = prepare_input($_POST['ship_postalcode']);
$sameBilling = prepare_input($_POST['sameBilling']);
$bill_address1 = $sameBilling == "1" ? $ship_address1 : prepare_input($_POST['bill_address1']);
$bill_address2 = $sameBilling == "1" ? $ship_address2 : prepare_input($_POST['bill_address2']);
$bill_city = $sameBilling == "1" ? $ship_city : prepare_input($_POST['bill_city']);
$bill_state = $sameBilling == "1" ? $ship_state : prepare_input($_POST['bill_state']);
$bill_postalcode = $sameBilling == "1" ? $ship_postalcode : prepare_input($_POST['bill_postalcode']);
$paytype = prepare_input($_POST['paytype']);
$sess_orderID = prepare_input($_POST["currOrderId"]);
$_SESSION['orderStatus'] = $sess_orderStatus = "review";
//update orders table with these values.
//run the update query for the $pieceid.
$updQuery1 = "UPDATE `orders` SET `status` = ?, `paymenttype` = ?, `shippingaddress1` = ?, `shippingaddress2` = ?, `shippingstate` = ?, `shippingcity` = ?, `shippingpostal` = ?, `billingaddress1` = ?, `billingaddress2` = ?, `billingcity` = ?, `billingstate` = ?, `billingpostal` = ?, `useremail`= ?, `phone`= ? WHERE `orders`.`orderid` = {$sess_orderID} ";
$stmt = $dbcon->prepare($updQuery1);
$stmt->bind_param('ssssssssssssss', $sess_orderStatus, $paytype, $ship_address1, $ship_address2, $ship_state, $ship_city, $ship_postalcode, $bill_address1, $bill_address2, $bill_state, $bill_city, $bill_postalcode, $email_info, $phone);
if (!$stmt->execute()) {
die('Error : (' . $dbcon->errno . ') ' . $dbcon->error);
}
$stmt->close();
$shipAddressStr = $ship_address1 . ", <br>";
if (!empty($ship_address2)) {
$shipAddressStr .= $ship_address2 . ", <br>";
}
$shipAddressStr .= $ship_city . ", " . $ship_state . ", India <br>";
示例10: isset
$INSTALL_OS_TYPE_INFO = $INSTALL_EMAIL_ADDRESS_INFO = $INSTALL_SITE_NAME_INFO = '';
$INSTALL_EMAIL_PASSWORD_INFO = $INSTALL_HELPDESK_MAILSERVER_INFO = $INSTALL_SEO_URLS_INFO = '';
if (file_exists(FILE_TMP_CONFIG)) {
@unlink(FILE_TMP_CONFIG);
}
if ($action == 'config') {
break;
}
$error = false;
$INSTALL_TEMPLATE = isset($_POST['TEMPLATE']) ? prepare_input($_POST['TEMPLATE']) : DEFAULT_TEMPLATE;
$INSTALL_OS_TYPE = isset($_POST['INSTALL_OS_TYPE']) ? (int) $_POST['INSTALL_OS_TYPE'] : 0;
$INSTALL_SEO_URLS = isset($_POST['INSTALL_SEO_URLS']) ? 1 : 0;
$INSTALL_EMAIL_ADDRESS = isset($_POST['INSTALL_EMAIL_ADDRESS']) ? prepare_input($_POST['INSTALL_EMAIL_ADDRESS']) : '';
$INSTALL_EMAIL_PASSWORD = isset($_POST['INSTALL_EMAIL_PASSWORD']) ? prepare_input($_POST['INSTALL_EMAIL_PASSWORD']) : '';
$INSTALL_SITE_NAME = isset($_POST['INSTALL_SITE_NAME']) ? prepare_input($_POST['INSTALL_SITE_NAME']) : '';
$INSTALL_HELPDESK_MAILSERVER = isset($_POST['INSTALL_HELPDESK_MAILSERVER']) ? prepare_input($_POST['INSTALL_HELPDESK_MAILSERVER']) : '';
if (empty($INSTALL_EMAIL_ADDRESS)) {
$INSTALL_EMAIL_ADDRESS_INFO = ERROR_EMAIL_ADDRESS;
$error = true;
}
if (empty($INSTALL_SITE_NAME)) {
$INSTALL_SITE_NAME_INFO = ERROR_SITE_NAME;
$error = true;
}
$contents = '';
read_contents(FILE_TMP_FRONT_SERVER, $contents);
eval($contents);
$templates_array = array();
$dir_array = array_filter(glob('templates/' . '*'), 'is_dir');
$template_found = false;
foreach ($dir_array as $key => $value) {
示例11: array
$params_tab3 = array();
$params_tab3['date_format'] = isset($_POST['date_format']) ? prepare_input($_POST['date_format']) : $objSettings->GetParameter('date_format');
$params_tab3['time_zone'] = isset($_POST['time_zone']) ? prepare_input($_POST['time_zone']) : $objSettings->GetParameter('time_zone');
$params_tab3["price_format"] = isset($_POST['price_format']) ? prepare_input($_POST['price_format']) : $objSettings->GetParameter("price_format");
$params_tab4 = array();
$params_tab4['mailer'] = isset($_POST['mailer']) ? prepare_input($_POST['mailer']) : $objSettings->GetParameter('mailer');
$params_tab4['admin_email'] = isset($_POST['admin_email']) ? prepare_input($_POST['admin_email']) : $objSettings->GetParameter('admin_email');
$params_tab4['mailer_type'] = isset($_POST['mailer_type']) ? prepare_input($_POST['mailer_type']) : $objSettings->GetParameter('mailer_type');
$params_tab4['smtp_host'] = isset($_POST['smtp_host']) ? prepare_input($_POST['smtp_host']) : $objSettings->GetParameter('smtp_host');
$params_tab4['smtp_port'] = isset($_POST['smtp_port']) ? prepare_input($_POST['smtp_port']) : $objSettings->GetParameter('smtp_port');
$params_tab4['smtp_username'] = isset($_POST['smtp_username']) ? prepare_input($_POST['smtp_username']) : $objSettings->GetParameter('smtp_username');
$params_tab4['smtp_password'] = isset($_POST['smtp_password']) ? prepare_input($_POST['smtp_password']) : $objSettings->GetParameter('smtp_password');
$params_cron = array();
$params_cron['cron_type'] = isset($_POST['cron_type']) ? prepare_input($_POST['cron_type']) : $objSettings->GetParameter('cron_type');
$params_cron['cron_run_period'] = isset($_POST['cron_run_period']) ? prepare_input($_POST['cron_run_period']) : $objSettings->GetParameter('cron_run_period');
$params_cron['cron_run_period_value'] = isset($_POST['cron_run_period_value']) ? prepare_input($_POST['cron_run_period_value']) : $objSettings->GetParameter('cron_run_period_value');
// SAVE CHANGES
if ($submition_type == 'general') {
if (strlen($params['offline_message']) > 255) {
$msg_text = str_replace('_FIELD_', '<b>' . _OFFLINE_MESSAGE . '</b>', _FIELD_LENGTH_ALERT);
$msg_text = str_replace('_LENGTH_', '255', $msg_text);
$msg = draw_important_message($msg_text, false);
$focus_on_field = 'offline_message';
} else {
if ($objSettings->UpdateFields($params) == true) {
$msg = draw_success_message(_SETTINGS_SAVED, false);
} else {
$msg = draw_important_message($objSettings->error, false);
}
}
} else {
示例12: defined
<?php
/**
* @project ApPHP Business Directory
* @copyright (c) 2011 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if ($objLogin->IsLoggedInAs('owner', 'mainadmin')) {
$file = isset($_GET['file']) ? prepare_input($_GET['file']) : '';
if ($file == 'export.csv') {
$file_path = 'tmp/export/' . $file;
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
// Date in the past
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
// always modified
header('Cache-Control: no-cache, must-revalidate');
// HTTP/1.1
header('Pragma: no-cache');
// HTTP/1.0
header('Content-type: application/force-download');
header('Content-Disposition: inline; filename="' . $file . '"');
header('Content-Transfer-Encoding: binary');
header('Content-length: ' . filesize($file_path));
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $file . '"');
readfile($file_path);
exit(0);
示例13: isset
}
if (substr($imagebasedir, -1, 1) != '/' && $imagebasedir != '') {
$imagebasedir = $imagebasedir . '/';
}
$leadon = $imagebasedir;
if ($leadon == '.') {
$leadon = '';
}
if (substr($leadon, -1, 1) != '/' && $leadon != '') {
$leadon = $leadon . '/';
}
$startdir = $leadon;
$file = isset($_GET['file']) ? prepare_input($_GET['file']) : "";
$get_dir = isset($_GET['dir']) ? prepare_input($_GET['dir']) : "";
$get_sort = isset($_GET['sort']) ? prepare_input($_GET['sort']) : "";
$get_order = isset($_GET['order']) ? prepare_input($_GET['order']) : "";
$dotdotdir = "";
$dirok = false;
$basedir = "";
// delete image from gallery
if ($allowuploads) {
if (!$is_demo) {
@unlink($leadon . $file);
}
}
if ($get_dir) {
$dir = base64_decode($get_dir);
if (substr($dir, -1, 1) != '/') {
$dir = $dir . '/';
}
$dirok = true;
示例14: AfterInsertRecord
/**
* After-insertion function
*/
public function AfterInsertRecord()
{
$name = isset($_POST['descr_name']) ? prepare_input($_POST['descr_name']) : '';
$description = isset($_POST['descr_description']) ? prepare_input($_POST['descr_description']) : '';
// languages array
$total_languages = Languages::GetAllActive();
foreach ($total_languages[0] as $key => $val) {
$sql = 'INSERT INTO ' . TABLE_CATEGORIES_DESCRIPTION . '(
id, category_id, language_id, name, description)
VALUES(
NULL, ' . $this->lastInsertId . ', \'' . $val['abbreviation'] . '\', \'' . $name . '\', \'' . $description . '\'
)';
if (!database_void_query($sql)) {
// error
}
}
}
示例15: defined
<?php
/**
* @project ApPHP Business Directory
* @copyright (c) 2011 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
$task = isset($_POST['task']) ? prepare_input($_POST['task']) : '';
$keyword = isset($_POST['keyword']) ? strip_tags(prepare_input($_POST['keyword'])) : '';
if ($keyword == _SEARCH_KEYWORDS . '...') {
$keyword = '';
}
$p = isset($_POST['p']) ? (int) $_POST['p'] : '';
$objSearch = new Search();
$search_result = '';
$title_bar = _LOOK_IN . ':
<select class="look_in" name="search_in" onchange="javascript:document.getElementById(\'search_in\').value=this.value;appQuickSearch();">
<option value="listings" ' . (Application::Get('search_in') == 'listings' ? 'selected="selected"' : '') . '>' . _LISTINGS . '</option>
<option value="pages" ' . (Application::Get('search_in') == 'pages' ? 'selected="selected"' : '') . '>' . _PAGES . '</option>
<option value="news" ' . (Application::Get('search_in') == 'news' ? 'selected="selected"' : '') . '>' . _NEWS . '</option>
</select>';
// Check if there is a page
if ($keyword != '') {
draw_title_bar(_SEARCH_RESULT_FOR . ': ' . $keyword . '', $title_bar);
if ($task == 'quick_search') {
$search_result = $objSearch->SearchBy($keyword, $p, Application::Get('search_in'));
}