当前位置: 首页>>代码示例>>PHP>>正文


PHP filter_sql函数代码示例

本文整理汇总了PHP中filter_sql函数的典型用法代码示例。如果您正苦于以下问题:PHP filter_sql函数的具体用法?PHP filter_sql怎么用?PHP filter_sql使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了filter_sql函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: db_insert

function db_insert($tbl, $fields)
{
    global $db;
    $count = 0;
    $query_fields = array();
    $query_values = array();
    foreach ($fields as $field => $val) {
        $query_fields[] = $field;
        $needle = substr($val, 0, 2);
        if ($needle != '{{') {
            $query_values[] = "'" . filter_sql($val) . "'";
        } else {
            $val = substr($val, 2, strlen($val) - 4);
            $query_values[] = filter_sql($val);
        }
        $count++;
    }
    $fields_query = implode(',', $query_fields);
    $values_query = implode(',', $query_values);
    //Complete Query
    $query = "INSERT INTO {$tbl} ({$fields_query}) VALUES ({$values_query}) {$ep}";
    //if(!mysql_query($query)) die($query.'<br>'.mysql_error());
    $db->total_queries++;
    $db->total_queries_sql[] = $query;
    try {
        $db->mysqli->query($query);
    } catch (DB_Exception $e) {
        $e->getError();
    }
    return $db->insert_id();
}
开发者ID:Coding110,项目名称:cbvideo,代码行数:31,代码来源:functions_db.php

示例2: destroy

 function destroy($id)
 {
     global $mydatabase;
     // Build query
     //      $newid = mysql_real_escape_string($id,$mydatabase->CONN);
     $newid = filter_sql($id);
     $sql = "DELETE FROM `livehelp_sessions` WHERE `session_id` ='{$newid}'";
     if (isset($mydatabase)) {
         $mydatabase->query($sql);
     }
     return true;
 }
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:12,代码来源:sessionmanager.php

示例3: array

            $graph = array();
            $graph[] = $row[0];
            recursive_delete_pages($row[0], 'livehelp_visits_monthly', $graph);
        }
    }
    // Delete old Keywords:
    $sqlquery = "SELECT COUNT(*) as totalkeywords FROM livehelp_keywords_monthly WHERE dateof={$monthago}";
    $rs = $mydatabase->query($sqlquery);
    $row = $rs->fetchRow(DB_FETCHMODE_ORDERED);
    $totalkeywords = $row[0];
    // if we have more keywords then we should have for previous month:
    if ($totalkeywords > $CSLH_Config['topkeywords']) {
        $query = "SELECT keywords FROM livehelp_keywords_monthly WHERE dateof={$monthago} ORDER by levelvisits DESC LIMIT " . $CSLH_Config['topkeywords'] . ",1000";
        $sth = $mydatabase->query($query);
        while ($row = $sth->fetchRow(DB_FETCHMODE_ORDERED)) {
            $keywords = filter_sql($row[0]);
            $q = "DELETE FROM livehelp_keywords_monthly WHERE keywords='{$keywords}'";
            $mydatabase->query($q);
            $q = "DELETE FROM livehelp_keywords_daily WHERE keywords='{$keywords}'";
            $mydatabase->query($q);
        }
    }
}
// If current database table is big:
//------------------------------------------------
$randomNumber = rand(1, 999);
$thismonth = date("Ym", mktime(2, 0, 0, date("m"), date("d"), date("Y")));
if ($dbtype != "txt-db-api" && $CSLH_Config['tracking'] == "Y" && $randomNumber == 17) {
    if (empty($CSLH_Config['maxrecords'])) {
        $CSLH_Config['maxrecords'] = 50000;
    }
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:gc.php

示例4: intval

    $rs = $sth->fetchRow(DB_FETCHMODE_ASSOC);
    $channelcolor = $rs['channelcolor'];
    $txtcolor = $rs['txtcolor'];
    $txtcolor_alt = $rs['txtcolor_alt'];
    // get the usernames:
    $query = "SELECT username FROM livehelp_users WHERE user_id=" . intval($rs['user_id']);
    $sth = $mydatabase->query($query);
    $rs2 = $sth->fetchRow(DB_FETCHMODE_ASSOC);
    $txtcolor_username = $rs2['username'];
    $query = "SELECT username FROM livehelp_users WHERE user_id=" . intval($rs['userid']);
    $sth = $mydatabase->query($query);
    $rs2 = $sth->fetchRow(DB_FETCHMODE_ASSOC);
    $txtcolor_alt_username = $rs2['username'];
}
if ($UNTRUSTED['whattodo'] == "UPDATE") {
    $query = "UPDATE livehelp_operator_channels SET txtcolor_alt='" . filter_sql($UNTRUSTED['txtcolor_alt']) . "',channelcolor='" . filter_sql($UNTRUSTED['channelcolor']) . "',txtcolor='" . filter_sql($UNTRUSTED['txtcolor']) . "' WHERE channel=" . intval($UNTRUSTED['id']);
    $sth = $mydatabase->query($query);
    ?>
<script type="text/javascript">window.location.replace('live.php');</script>
<?php 
    exit;
}
$selectedtab = "visit";
include "mobileheader.php";
?>
<script type="text/javascript">
var myScroll;
window.addEventListener('orientationchange', setHeight);

function setHeight() {
	document.getElementById('wrapper').style.height = window.orientation == 90 || window.orientation == -90 ? '85px' : '300px';
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:chat_color.php

示例5: initialization_database

function initialization_database()
{
    // Clear IP Activity and Banlist for next start
    mysql_query("TRUNCATE TABLE `ip_activity`");
    mysql_query("TRUNCATE TABLE `ip_banlist`");
    // Clear Active & New Peers List
    mysql_query("DELETE FROM `active_peer_list` WHERE `active_peer_list`.`join_peer_list` != 0");
    // Permanent Peers Ignored
    mysql_query("TRUNCATE TABLE `new_peers_list`");
    // Record when started
    mysql_query("UPDATE `options` SET `field_data` = '" . time() . "' WHERE `options`.`field_name` = 'timekoin_start_time' LIMIT 1");
    //**************************************
    // Upgrade Database from v3.x earlier versions
    // Auto IP Update Settings
    $new_record_check = mysql_result(mysql_query("SELECT * FROM `options` WHERE `field_name` = 'auto_update_generation_IP' LIMIT 1"), 0, 0);
    if ($new_record_check === FALSE) {
        // Does not exist, create it
        mysql_query("INSERT INTO `options` (`field_name` ,`field_data`) VALUES ('auto_update_generation_IP', '0')");
    }
    // CLI Mode Settings
    $new_record_check = mysql_result(mysql_query("SELECT * FROM `options` WHERE `field_name` = 'cli_mode' LIMIT 1"), 0, 0);
    if ($new_record_check === FALSE) {
        // Does not exist, create it
        mysql_query("INSERT INTO `options` (`field_name` ,`field_data`) VALUES ('cli_mode', '1')");
    }
    // CLI Mode Port Settings
    $new_record_check = mysql_result(mysql_query("SELECT * FROM `options` WHERE `field_name` = 'cli_port' LIMIT 1"), 0, 0);
    if ($new_record_check === FALSE) {
        // Does not exist, create it
        mysql_query("INSERT INTO `options` (`field_name` ,`field_data`) VALUES ('cli_port', '')");
    }
    // IPv4 + IPv6 Network Mode
    $new_record_check = mysql_result(mysql_query("SELECT * FROM `options` WHERE `field_name` = 'network_mode' LIMIT 1"), 0, 0);
    if ($new_record_check === FALSE) {
        // Does not exist, create it
        mysql_query("INSERT INTO `options` (`field_name` ,`field_data`) VALUES ('network_mode', '1')");
    }
    // IPv6 Generation IP Field
    $new_record_check = mysql_result(mysql_query("SELECT * FROM `options` WHERE `field_name` = 'generation_IP_v6' LIMIT 1"), 0, 0);
    if ($new_record_check === FALSE) {
        // Does not exist, create it
        mysql_query("INSERT INTO `options` (`field_name` ,`field_data`) VALUES ('generation_IP_v6', '')");
    }
    //**************************************
    // Check for an empty generation IP address,
    // if none exist, attempt to auto-detect one
    // and fill in the field.
    $poll_IP = mysql_result(mysql_query("SELECT field_data FROM `options` WHERE `field_name` = 'generation_IP' LIMIT 1"), 0, 0);
    if (empty($poll_IP) == TRUE) {
        ini_set('user_agent', 'Timekoin Server (Main) v' . TIMEKOIN_VERSION);
        ini_set('default_socket_timeout', 3);
        // Timeout for request in seconds
        $poll_IP = filter_sql(poll_peer(NULL, 'timekoin.net', NULL, 80, 46, "ipv4.php"));
        if (empty($poll_IP) == FALSE) {
            mysql_query("UPDATE `options` SET `field_data` = '{$poll_IP}' WHERE `options`.`field_name` = 'generation_IP' LIMIT 1");
        }
    }
    //**************************************
    // Main Loop Status & Active Options Setup
    // Truncate to Free RAM
    mysql_query("TRUNCATE TABLE `main_loop_status`");
    $time = time();
    //**************************************
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('balance_last_heartbeat', '1')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('foundation_last_heartbeat', '1')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('generation_last_heartbeat', '1')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('genpeer_last_heartbeat', '1')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('main_heartbeat_active', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('main_last_heartbeat', '{$time}')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('peerlist_last_heartbeat', '1')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('queueclerk_last_heartbeat', '1')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('transclerk_last_heartbeat', '1')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('treasurer_last_heartbeat', '1')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('watchdog_heartbeat_active', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('watchdog_last_heartbeat', '{$time}')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('peer_transaction_start_blocks', '1')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('peer_transaction_performance', '10')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('block_check_back', '1')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('block_check_start', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('firewall_blocked_peer', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('foundation_block_check', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('foundation_block_check_end', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('foundation_block_check_start', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('generation_peer_list_no_sync', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('no_peer_activity', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('time_sync_error', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('transaction_history_block_check', '0')");
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('update_available', '0')");
    //**************************************
    // Copy values from Database to RAM Database
    $db_to_RAM = mysql_result(mysql_query("SELECT field_data FROM `options` WHERE `field_name` = 'allow_ambient_peer_restart' LIMIT 1"), 0, 0);
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('allow_ambient_peer_restart', '{$db_to_RAM}')");
    $db_to_RAM = mysql_result(mysql_query("SELECT field_data FROM `options` WHERE `field_name` = 'allow_LAN_peers' LIMIT 1"), 0, 0);
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('allow_LAN_peers', '{$db_to_RAM}')");
    $db_to_RAM = mysql_result(mysql_query("SELECT field_data FROM `options` WHERE `field_name` = 'server_request_max' LIMIT 1"), 0, 0);
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('server_request_max', '{$db_to_RAM}')");
    $db_to_RAM = mysql_result(mysql_query("SELECT field_data FROM `options` WHERE `field_name` = 'max_active_peers' LIMIT 1"), 0, 0);
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('max_active_peers', '{$db_to_RAM}')");
    $db_to_RAM = mysql_result(mysql_query("SELECT field_data FROM `options` WHERE `field_name` = 'max_new_peers' LIMIT 1"), 0, 0);
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('max_new_peers', '{$db_to_RAM}')");
//.........这里部分代码省略.........
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:101,代码来源:function.php

示例6: mysql_connect

}
//***********************************************************************************
//***********************************************************************************
// Open persistent connection to database
mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
mysql_select_db(MYSQL_DATABASE);
// Check for banned IP address
if (ip_banned($_SERVER['REMOTE_ADDR']) == TRUE) {
    // Sorry, your IP address has been banned :(
    exit;
}
//***********************************************************************************
//***********************************************************************************
// Answer public key balance request that match our hash code
if ($_GET["action"] == "key_balance") {
    $hash_code = substr($_GET["hash"], 0, 256);
    $server_hash_code = mysql_result(mysql_query("SELECT * FROM `options` WHERE `field_name` = 'server_hash_code' LIMIT 1"), 0, "field_data");
    if ($hash_code == $server_hash_code && $server_hash_code != "0") {
        // Grab balance for public key and return back
        $public_key = substr($_POST["public_key"], 0, 500);
        $public_key = filter_sql(base64_decode($public_key));
        echo check_crypt_balance($public_key);
    }
    // Log inbound IP activity
    log_ip("AP");
    exit;
}
//***********************************************************************************
//***********************************************************************************
// Log IP even when not using any functions
log_ip("AP");
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:api.php

示例7: send_timekoins

function send_timekoins($my_private_key, $my_public_key, $send_to_public_key, $amount, $message)
{
    $arr1 = str_split($send_to_public_key, 181);
    openssl_private_encrypt($arr1[0], $encryptedData1, $my_private_key);
    $encryptedData64_1 = base64_encode($encryptedData1);
    openssl_private_encrypt($arr1[1], $encryptedData2, $my_private_key);
    $encryptedData64_2 = base64_encode($encryptedData2);
    if (empty($message) == TRUE) {
        $transaction_data = "AMOUNT={$amount}---TIME=" . time() . "---HASH=" . hash('sha256', $encryptedData64_1 . $encryptedData64_2);
    } else {
        // Sanitization of message
        // Filter symbols that might lead to a transaction hack attack
        $symbols = array("|", "?", "=");
        // SQL + URL
        $message = str_replace($symbols, "", $message);
        // Trim any message to 64 characters max and filter any sql
        $message = filter_sql(substr($message, 0, 64));
        $transaction_data = "AMOUNT={$amount}---TIME=" . time() . "---HASH=" . hash('sha256', $encryptedData64_1 . $encryptedData64_2) . "---MSG={$message}";
    }
    openssl_private_encrypt($transaction_data, $encryptedData3, $my_private_key);
    $encryptedData64_3 = base64_encode($encryptedData3);
    $triple_hash_check = hash('sha256', $encryptedData64_1 . $encryptedData64_2 . $encryptedData64_3);
    $sql = "INSERT INTO `my_transaction_queue` (`timestamp`,`public_key`,`crypt_data1`,`crypt_data2`,`crypt_data3`, `hash`, `attribute`)\nVALUES ('" . time() . "', '{$my_public_key}', '{$encryptedData64_1}', '{$encryptedData64_2}' , '{$encryptedData64_3}', '{$triple_hash_check}' , 'T')";
    if (mysql_query($sql) == TRUE) {
        // Success code
        return TRUE;
    } else {
        return FALSE;
    }
}
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:30,代码来源:function.php

示例8: mysql_query

     // Keep track of errors in case this can't be recovered from
     $datbase_error = TRUE;
     $database_error_counter++;
 } else {
     $datbase_error = 0;
     $database_error_counter = 0;
 }
 if ($loop_active == 1) {
     // Main loop work goes below
     // Set the working status of 2
     mysql_query("UPDATE `main_loop_status` SET `field_data` = '2' WHERE `main_loop_status`.`field_name` = 'main_heartbeat_active' LIMIT 1");
     //*****************************************************************************************************
     //*****************************************************************************************************
     // Do a random time sync check and report any errors to the user
     if (rand(1, 99) == 30) {
         $poll_peer = filter_sql(file_get_contents("http://timekoin.net/time.php", FALSE, $context, NULL, 12));
         $my_time = time();
         if (abs($poll_peer - $my_time) > 15 && empty($poll_peer) == FALSE) {
             // Timekoin peer time is not in sync
             mysql_query("UPDATE `main_loop_status` SET `field_data` = '1' WHERE `main_loop_status`.`field_name` = 'time_sync_error' LIMIT 1");
         } else {
             // Timekoin peer time is in sync
             mysql_query("UPDATE `main_loop_status` SET `field_data` = '0' WHERE `main_loop_status`.`field_name` = 'time_sync_error' LIMIT 1");
         }
     }
     //*****************************************************************************************************
     //*****************************************************************************************************
     // Do a update software check and report to user if one is available
     if (rand(1, 300) == 100) {
         if (check_for_updates(TRUE) == 1) {
             // Update available, alert user
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:main.php

示例9: intval

    $check_s = $mydatabase->query($query);
    $check_s = $check_s->fetchRow(DB_FETCHMODE_ASSOC);
    if ($check_s['status'] != "chat") {
        $query = "UPDATE livehelp_users set status='request' WHERE user_id=" . intval($saidto);
        $mydatabase->query($query);
    }
    $query = "DELETE FROM livehelp_messages WHERE typeof='writediv'";
    $mydatabase->query($query);
    // see if we have same timestamp: a performance issue but actually done on perpose to discourage
    // people making hosted solutions with multiple chats all using the same system.
    $query = "SELECT timeof FROM livehelp_messages WHERE timeof='{$timeof}'";
    $rs = $mydatabase->query($query);
    while ($rs->numrows() != 0) {
        if (function_exists('sleep')) {
            sleep(1);
            $timeof = date("YmdHis");
        } else {
            $timeof++;
        }
        $query = "SELECT timeof FROM livehelp_messages WHERE timeof='{$timeof}'";
        $rs = $mydatabase->query($query);
    }
    if (!empty($UNTRUSTED['smilies'])) {
        $UNTRUSTED['comment'] = convert_smile($UNTRUSTED['comment']);
    }
    $query = "INSERT INTO livehelp_messages (message,channel,timeof,saidfrom,saidto) VALUES ('" . filter_sql($UNTRUSTED['comment']) . "'," . intval($channel) . ",'{$timeof}'," . intval($myid) . "," . intval($saidto) . ")";
    $mydatabase->query($query);
    $quicknote = "";
}
?>
 
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:30,代码来源:xmlhttp.php

示例10: filter_sql

        echo $UNTRUSTED['keywords'];
    }
    ?>
" ><a href=javascript:document.dataformrefer.submit()><img src=images/go.gif width=20 height=20 border=0></a></td>
</tr>
	
</table>

</FORM>
<table bgcolor=DDDDDD width=600><tr><td>
<b>Key Words:</b></td></tr></table>
  
<?php 
    $keywordssql = "";
    if (!empty($UNTRUSTED['keywords'])) {
        $keywordssql = " AND keywords LIKE '%" . filter_sql($UNTRUSTED['keywords']) . "%' ";
    }
    $query = "SELECT * FROM livehelp_keywords_monthly WHERE dateof={$whatYm} {$keywordssql} AND department='" . intval($UNTRUSTED['whichdepartment']) . "' ORDER by levelvisits DESC";
    $refer_a = $mydatabase->query($query);
    $total_p = $refer_a->numrows();
    $perpage = intval($UNTRUSTED['perpage']);
    $top = intval($UNTRUSTED['top']);
    $show = $UNTRUSTED['show'];
    $pageUrl = "data.php";
    $varstring = "&tab=" . $UNTRUSTED['tab'] . "&month=" . $UNTRUSTED['month'] . "&year=" . $UNTRUSTED['year'] . "&whichdepartment=" . intval($UNTRUSTED['whichdepartment']);
    if (empty($UNTRUSTED['perpage'])) {
        $UNTRUSTED['perpage'] = 25;
    }
    if (empty($UNTRUSTED['offset'])) {
        $UNTRUSTED['offset'] = 0;
    }
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:data_keywords.php

示例11: RAND

 if (empty($my_server_domain) == TRUE) {
     // No domain used
     $my_server_domain = "NA";
 }
 // Add more possible peers to the new peer list by polling what the active peers have
 $sql = "SELECT * FROM `active_peer_list` ORDER BY RAND() LIMIT 10";
 $sql_result = mysql_query($sql);
 $sql_num_results = mysql_num_rows($sql_result);
 $new_peer_difference = $max_new_peers - $new_peers_numbers;
 for ($i = 0; $i < $sql_num_results; $i++) {
     $sql_row = mysql_fetch_array($sql_result);
     $ip_address = $sql_row["IP_Address"];
     $domain = $sql_row["domain"];
     $subfolder = $sql_row["subfolder"];
     $port_number = $sql_row["port_number"];
     $poll_peer = filter_sql(poll_peer($ip_address, $domain, $subfolder, $port_number, 10000, "peerlist.php?action=new_peers"));
     $peer_counter = 1;
     // Reset peer counter
     while ($peer_counter <= 15) {
         $peer_IP = NULL;
         $peer_domain = NULL;
         $peer_subfolder = NULL;
         $peer_port_number = NULL;
         // Sort Data
         $peer_IP = find_string("-----IP{$peer_counter}=", "-----domain{$peer_counter}", $poll_peer);
         $peer_domain = find_string("-----domain{$peer_counter}=", "-----subfolder{$peer_counter}", $poll_peer);
         $peer_subfolder = find_string("-----subfolder{$peer_counter}=", "-----port_number{$peer_counter}", $poll_peer);
         $peer_port_number = find_string("-----port_number{$peer_counter}=", "-----", $poll_peer);
         if (is_domain_valid($peer_domain) == FALSE) {
             // Someone is using an IP address or Localhost :p
             $peer_domain = NULL;
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:peerlist.php

示例12: filter_sql

    $externalchats = "";
    for ($i = 0; $i < count($externalchats_array); $i++) {
        if ($channel != $externalchats_array[$i]) {
            $externalchats = $externalchats . ",{$externalchats_array[$i]}";
        }
    }
    $sqlquery = "UPDATE livehelp_users SET externalchats='" . filter_sql($externalchats) . "' WHERE sessionid='" . $identity['SESSIONID'] . "'";
    $mydatabase->query($sqlquery);
    print "<SCRIPT type=\"text/javascript\">window.close();</SCRIPT>";
    exit;
} else {
    if (!in_array($channel, $externalchats_array)) {
        array_push($externalchats_array, $channel);
        $externalchats = $externalchats . ",{$channel}";
    }
    $sqlquery = "UPDATE livehelp_users SET externalchats='" . filter_sql($externalchats) . "' WHERE sessionid='" . $identity['SESSIONID'] . "'";
    $mydatabase->query($sqlquery);
}
// who is this?
$sqlq = "SELECT username FROM livehelp_users WHERE user_id=" . intval($user_id);
$rs = $mydatabase->query($sqlq);
$row = $rs->fetchRow(DB_FETCHMODE_ORDERED);
$thisusername = $row[0];
if (!$serversession) {
    $mydatabase->close_connect();
}
?>
<html>
	<head>
<title><?php 
echo $thisusername;
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:external_frameset.php

示例13: str_replace

    if (!empty($dataset[1])) {
        $fieldid = str_replace("field_", "", $dataset[0]);
        $query = "SELECT * FROM livehelp_questions WHERE id=" . intval($fieldid);
        $questiondata = $mydatabase->query($query);
        $question_row = $questiondata->fetchRow(DB_FETCHMODE_ASSOC);
        print "<b> " . $question_row['headertext'] . ":</b> <br><font color=000000>" . urldecode($dataset[1]) . "</font><br>";
    }
}
$now = date("YmdHis");
$thediff = $now - $user_info['lastaction'];
print "<b>" . $lang['txt65'] . "</b> {$thediff} sec. <br>";
// time online:
$query = "SELECT whendone from livehelp_visit_track WHERE sessionid='" . filter_sql($user_info['sessionid']) . "' Order by whendone LIMIT 1";
$page_trail = $mydatabase->query($query);
$page = $page_trail->fetchRow(DB_FETCHMODE_ASSOC);
$later = $page['whendone'];
print "<b>Time online:</b>" . secondstoHHmmss(timediff($later, date("YmdHis"))) . "<br>";
print "<b>" . $lang['txt66'] . "</b><br>";
$query = "SELECT * from livehelp_visit_track WHERE sessionid='" . filter_sql($user_info['sessionid']) . "' Order by whendone DESC";
$page_trail = $mydatabase->query($query);
print "<table border=1><tr bgcolor=FFFFFF><td>" . $lang['txt67'] . "</td><td>url</td><td>" . $lang['date'] . "</td></tr>";
while ($page = $page_trail->fetchRow(DB_FETCHMODE_ASSOC)) {
    $when = mktime(substr($page['whendone'], 8, 2), substr($page['whendone'], 10, 2), substr($page['whendone'], 12, 2), substr($page['whendone'], 4, 2), substr($page['whendone'], 6, 2), substr($page['whendone'], 0, 4));
    print "<tr><td>" . $page['title'] . "</td><td><a href=" . $page['location'] . "  target=_blank>" . $page['location'] . "</a></td><td>";
    print date("F j, Y, g:i a", $when);
    print "</td></tr>";
}
print "</table><br><center><a href=javascript:window.close()>" . $lang['txt40'] . "</a>";
if (!$serversession) {
    $mydatabase->close_connect();
}
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:details.php

示例14: while

        $username_s = $newusername;
        if ($newusername == "") {
            $newusername = "no name";
        }
        while ($count != 0) {
            $query = "SELECT * \n              FROM livehelp_users \n              WHERE username='" . filter_sql($newusername) . "'";
            $count_a = $mydatabase->query($query);
            $count = $count_a->numrows();
            if ($count != 0) {
                $newusername = $username_s . "_" . $countnum;
            }
            $countnum++;
        }
        $useremail = str_replace("\\'", "", $useremail);
        $useremail = str_replace("'", "", $useremail);
        $query = "UPDATE livehelp_users \n            SET email='" . filter_sql($useremail) . "',isnamed='Y',askquestions='N',username='" . filter_sql($newusername) . "',sessiondata='{$sessiondata}' \n            WHERE sessionid='" . $identity['SESSIONID'] . "'";
        $mydatabase->query($query);
        $query = "SELECT * \n            FROM livehelp_users \n            WHERE sessionid='" . $identity['SESSIONID'] . "'";
        $people = $mydatabase->query($query);
        $people = $people->fetchRow(DB_FETCHMODE_ASSOC);
        $myid = $people['user_id'];
        $channel = $people['onchannel'];
        $isnamed = $people['isnamed'];
        $isnamed = "Y";
        ?>
    <SCRIPT type="text/javascript">
    window.location.replace("user_connect.php?try=0&tab=1&doubleframe=yes&pageurl=offline.php&department=<?php 
        echo $UNTRUSTED['department'];
        ?>
");       
    </SCRIPT>
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:user_questions.php

示例15: db_multi_insert

function db_multi_insert($tbl, $multi_fields)
{
    global $db;
    $count = 0;
    if ($multi_fields) {
        foreach ($multi_fields as $fields) {
            $query_fields = array();
            $query_values = array();
            foreach ($fields as $field => $val) {
                $query_fields[] = $field;
                $needle = substr($val, 0, 2);
                if ($needle != '{{') {
                    $query_values[] = "'" . filter_sql($val) . "'";
                } else {
                    $val = substr($val, 2, strlen($val) - 4);
                    $query_values[] = filter_sql($val);
                }
                $count++;
            }
            $fields_query = implode(',', $query_fields);
            $values_query[] = '(' . implode(',', $query_values) . ')';
        }
        $values_query_multi = implode(',', $values_query);
    }
    //Complete Query
    $query = "INSERT INTO {$tbl} ({$fields_query}) VALUES {$values_query_multi} ";
    /*//if(!mysql_query($query)) die($query.'<br>'.mysql_error());
        $db->total_queries++;
        $db->total_queries_sql[] = $query;
        $db->Execute($query);
    
        if (mysql_error())
        {
            //if(LOG_DB_ERRORS)
    
            die($db->db_query . '<br>' . mysql_error());
        }*/
    $db->write($query);
    return $db->insert_id();
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:40,代码来源:functions_db.php


注:本文中的filter_sql函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。