本文整理汇总了PHP中mysql_clean函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql_clean函数的具体用法?PHP mysql_clean怎么用?PHP mysql_clean使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql_clean函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AddModule
function AddModule()
{
$name = substr($_POST['module_file'], 0, strrpos($_POST['module_file'], '.instructions'));
$file = mysql_clean($_POST['module_file']);
$active = mysql_clean($_POST['active']);
if (empty($name)) {
$msg[] = "Module Name Is Empty";
} elseif (!$this->isValidModule($name)) {
$msg[] = "Module Name Is Not Valid";
}
$data = $this->GetModuleDetails($name);
if (!empty($data['module_name'])) {
$msg[] = "Module Already Exists";
}
if (empty($file)) {
$msg[] = "No File Selected";
}
if (!file_exists(MODULEDIR . '/' . $file)) {
$msg[] = "Specified File Does not Exists";
}
if (empty($msg)) {
mysql_query("INSERT INTO modules(module_name,module_file,active)VALUES('" . $name . "','" . $file . "','" . $active . "')");
$msg = "Module Has Been Added";
}
return $msg;
}
示例2: cb_verify_honeypot
function cb_verify_honeypot()
{
global $eh;
$salt = mysql_clean(post('cb_verifier'));
if ($salt) {
$timestamp_name = cb_honeypot_hash_fieldname('cb_timestamp', $salt);
$timestamp = mysql_clean(post($timestamp_name));
if ($timestamp) {
$difference = time() - $timestamp;
if ($difference < CB_HONEYPOT_FORM_SUBMISSION_WINDOW) {
e(lang(sprintf('Submitting form in %d %s. Are you even a human ?', $difference, $difference == 1 ? 'second' : 'seconds')));
return false;
}
$honeypot_name = cb_honeypot_hash_fieldname('cb_honeypot', $salt);
$honeypot = mysql_clean(post($honeypot_name));
if (CB_HONEYPOT_DEFAULT_VALUE == '') {
if ($honeypot != '') {
e(lang('Someone is tampering with forms. Can not process further.'));
return false;
}
} else {
if (!$honeypot or $honeypot != CB_HONEYPOT_DEFAULT_VALUE) {
e(lang('Someone is tampering with forms. Can not process further.'));
return false;
}
}
return true;
} else {
e(lang('Unable to locate timestamp. Can not process further.'));
}
} else {
e(lang('No verification code provided. Can not process further.'));
}
return false;
}
示例3: findContact
function findContact($email)
{
global $db;
$email = mysql_clean($email);
$info = $db->query("SELECT id FROM people WHERE email = {$email}");
return $info->id;
}
示例4: editors_pick
function editors_pick()
{
if ($_GET['add_editor_pick']) {
$vid = mysql_clean($_GET['add_editor_pick']);
add_to_editor_pick($vid);
}
if ($_GET['remove_editor_pick']) {
$vid = mysql_clean($_GET['remove_editor_pick']);
remove_vid_editors_pick($vid);
}
}
示例5: get_user_session
/**
* Function is used to get session
*/
function get_user_session($user, $session_name = false, $phpsess = false)
{
global $db;
if ($session_name) {
$session_cond = " session_string='" . mysql_clean($session_name) . "'";
}
if ($phpsess) {
if ($session_cond) {
$session_cond .= " AND ";
}
$session_cond .= " session ='" . $this->id . "' ";
}
$results = $db->select(tbl($this->tbl), '*', $session_cond);
return $results;
}
示例6: EditAd
/**
* Function used to edit advertisment
* @params Array
*/
function EditAd($array = NULL)
{
global $db;
if (!$array) {
$array = $_POST;
}
$placement = mysql_clean($array['placement']);
$name = mysql_clean($array['name']);
$code = mysql_real_escape_string(htmlspecialchars($array['code']));
$category = mysql_clean(@$array['category']);
$id = $array['ad_id'];
if (!$this->ad_exists($id)) {
e(lang("ad_exists_error1"));
} elseif (empty($name)) {
e(lang('ad_name_error'));
} else {
$db->update(tbl("ads_data"), array("ad_placement", "ad_name", "ad_category", "ad_code", "ad_status"), array($placement, $name, $category, "|no_mc|" . $code, $array['status'], $id), " ad_id='{$id}' ");
e(lang('ad_update_msg'), "m");
}
}
示例7: add_custom_field
/**
* Function used to add custom field in upload form
*/
function add_custom_field($array)
{
global $db, $LANG;
foreach ($array as $key => $attr) {
if ($key == 'name' || $key == 'title') {
if (empty($attr)) {
e(sprintf(lang('cust_field_err'), $key));
}
}
if (!error_list()) {
if (!empty($attr)) {
$fields_array[] = 'custom_field_' . $key;
$value_array[] = mysql_clean($attr);
}
if ($key == 'db_field') {
$db->execute("ALTER TABLE " . tbl('video') . " ADD `" . $attr . "` TEXT NOT NULL");
}
}
}
if (!error_list()) {
$db->insert(tbl("custom_fields"), $fields_array, $value_array);
}
}
示例8: Copyright
/*
*************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
*************************************************************
*/
define("THIS_PAGE", 'edit_group');
define("PARENT_PAGE", 'groups');
require 'includes/config.inc.php';
$userquery->logincheck();
$udetails = $userquery->get_user_details(userid());
assign('user', $udetails);
assign('p', $userquery->get_user_profile($udetails['userid']));
$gid = mysql_clean($_GET['group_id']);
//get group details
$gdetails = $cbgroup->get_group_details($gid);
$gArray = array('group' => $gdetails, 'groupid' => $gid, 'uid' => userid(), 'user' => $userquery->udetails, 'checkowner' => 'yes');
if (!$cbgroup->is_admin($gArray) && !has_access('admin_access', true)) {
e(lang("you_cant_edit_group"));
$Cbucket->show_page = false;
} else {
//Updating Video Details
if (isset($_POST['update_group'])) {
$_POST['group_id'] = $gid;
$cbgroup->update_group();
$gdetails = $cbgroup->get_group_details($gid);
}
assign('group', $gdetails);
}
示例9: define
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
****************************************************************
*/
require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
if (!defined('MAIN_PAGE')) {
define('MAIN_PAGE', 'Videos');
}
if (!defined('SUB_PAGE')) {
define('SUB_PAGE', "Editor's Pick");
}
//Removing
if (isset($_GET['remove'])) {
$id = mysql_clean($_GET['remove']);
remove_vid_editors_pick($id);
}
if (isset($_POST['delete_selected'])) {
for ($id = 0; $id <= count($_POST['check_video']); $id++) {
remove_vid_editors_pick($_POST['check_video'][$id]);
}
$eh->flush();
e("Selected videos have been removed from editors pick", "m");
}
$ep_videos = get_ep_videos();
if (isset($_POST['update_order'])) {
if (is_array($ep_videos)) {
foreach ($ep_videos as $epvid) {
$order = $_POST['ep_order_' . $epvid['pick_id']];
move_epick($epvid['videoid'], $order);
示例10: assign
$feed = $cbfeeds->get_feed($fid);
assign('feed', $feed);
if ($object_type) {
$template = get_template('single_feed_' . $object_type);
}
if (!$template) {
$template = get_template('single_feed');
}
$array = array('success' => 'ok', 'template' => $template, 'fid' => $fid);
echo json_encode($array);
} catch (Exception $e) {
exit(json_encode(array('err' => array($e->getMessage()))));
}
break;
case "get_notifications":
$uid = mysql_clean(post('userid'));
if (!$uid) {
$uid = userid();
}
$notifications = $cbfeeds->get_notifications('unread');
$updates = array();
if ($notifications) {
$total_new = 0;
$the_notifications = array();
$notification_template = '';
foreach ($notifications as $notification) {
$the_notifications['ids'][] = $notification['notification_id'];
//Lets create a template and append to it..
assign('notification', $notification);
$notification_template .= get_template('notification_block');
$total_new++;
示例11: switch
}
switch ($mode) {
case "view":
default:
assign("mode", "view");
//Getting Video List
$page = mysql_clean($_GET['page']);
$get_limit = create_query_limit($page, 5);
$photos = $cbphoto->action->get_flagged_objects($get_limit);
assign('photos', $photos);
//Collecting Data for Pagination
$total_rows = $cbphoto->action->count_flagged_objects();
$total_pages = count_pages($total_rows, 5);
//Pagination
$pages->paginate($total_pages, $page);
break;
case "view_flags":
assign("mode", "view_flags");
$pid = mysql_clean($_GET['pid']);
$pdetails = $cbphoto->get_photo($pid);
if ($pdetails) {
$flags = $cbphoto->action->get_flags($pid);
assign('flags', $flags);
assign('photo', $pdetails);
} else {
e("Photo does not exist");
}
}
subtitle("Flagged Photos");
template_files('flagged_photos.html');
display_it();
示例12: update_template
/**
* Function used to update email template
*/
function update_template($params)
{
global $db;
$id = mysql_clean($params['id']);
$subj = mysql_clean($params['subj']);
$msg = mysql_real_escape_string($params['msg']);
if (!$this->template_exists($id)) {
e(lang("email_template_not_exist"));
} elseif (empty($subj)) {
e(lang("email_subj_empty"));
} elseif (empty($msg)) {
e(lang("email_msg_empty"));
} else {
$db->update(tbl($this->db_tpl), array("email_template_subject", "email_template"), array($subj, '|no_mc|' . $msg), " email_template_id='{$id}'");
e(lang("email_tpl_has_updated"), "m");
}
}
示例13: lang
$login_success = lang('welcome_back') . ", {$_SESSION['user_name']}";
break;
}
} else {
// Incase your server doesn't classify booleans as numbers. Just incase.
$login_success = lang('welcome_back') . ", {$_SESSION['user_name']}";
}
} else {
$login_error = lang('error_invalid_user_pass');
}
}
} else {
if (isset($login_cookie)) {
$data = explode(":", $login_cookie);
$username = mysql_clean($data[0]);
$password = mysql_clean($data[1]);
$sql = "SELECT * FROM users WHERE username = '{$username}' AND password = '{$password}'";
$result = @$database->query($sql) or die("No.");
// Huge error
// Cookies don't match and no session, so tell them to logout!
if ($database->num($result) < 1) {
session_destroy();
unset($username);
unset($password);
include $config['template_path'] . "header.php";
print_out(lang('error_with_cookies'), lang_parse('error_cookie_body', array($config['url_path'] . '/logout.php')), false);
} else {
if ($database->num($result) > 0) {
// Get the users data
$user_data = $database->fetch($result);
// What is this user classified as?
示例14: mysql_clean
<?php
$userquery->get_user_details();
$adminemail = $userquery->get_user_field_only(1, 'email');
$title = mysql_clean(post('title'));
$slogan = mysql_clean(post('slogan'));
$baseurl = mysql_clean(post('baseurl'));
//First update website settings
$myquery->Set_Website_Details('site_title', $title);
$myquery->Set_Website_Details('site_slogan', $slogan);
$myquery->Set_Website_Details('baseurl', $baseurl);
?>
</div>
<div class="nav_des clearfix">
<div class="cb_container">
<h4 style="color:#fff">Registeration (Optional)</h4>
<p style="color:#fff; font-size:13px;">As you have installed ClipBucket Succesffuly, we highly recommend you to register your website on our Clipbucket. its really simple, just click on Register and continue and your website will be register on Clipbucket website</p>
</div><!--cb_container-->
</div><!--nav_des-->
<!--<h2>Registeration (Optional)</h2>
As you have installed ClipBucket Succesffuly, we highly recommend you to register your website on our Clipbucket. its really simple, just click on Register and continue and your website will be register on Clipbucket website<br />
<br />-->
<div id="sub_container" class="br5px">
<h3>Why we suggest registeration?</h3>
<div class="register">
示例15: header
header("Location: " . URL . "standard/{$_GET['table']}/saved");
exit;
}
$list = $db->query("SELECT * FROM {$table_name} WHERE active = 1 ORDER BY id");
if ($id) {
$info = $db->query("SELECT * FROM {$table_name} WHERE id = {$id}");
}
if ($_GET['saved']) {
$print = "Information has been saved";
}
if ($_GET['action'] == "mailchimp") {
require_once 'mailchimp.php';
$MailChimp = new \Drewm\MailChimp(MAILCHIMP_API_KEY);
$return = $MailChimp->call('lists/segment-add', array('id' => MAILCHIMP_LIST, 'opts' => array('type' => 'static', 'name' => $info->name)));
if ($return['id']) {
$post = array('mailchimp_id' => mysql_clean($return['id']));
$db->update($table_name, $post, "id = {$id}", 1);
header("Location: " . URL . "standard/mailinglist/edit/{$id}");
exit;
} else {
$error = "Segment was not created! <br />Error: " . $return['error'];
}
}
$mainorganizations = $db->query("SELECT * FROM organization_main_types WHERE active = 1 ORDER BY name");
?>
<!doctype html>
<html>
<head>
<title><?php
echo SITENAME;
?>