• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP filter_sql函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: mktime

}
$alterations_sql = "";
$prev = mktime(date("H"), date("i") - 35, date("s"), date("m"), date("d"), date("Y"));
$oldtime = date("YmdHis", $prev);
$rightnow = date("YmdHis");
if ($UNTRUSTED['alterations'] == "Y" && $UNTRUSTED['show_arrival_new'] == "") {
    $UNTRUSTED['show_arrival_new'] = "N";
}
if ($UNTRUSTED['alterations'] == "Y" && $UNTRUSTED['user_alert_new'] == "") {
    $UNTRUSTED['user_alert_new'] = "Y";
}
if ($UNTRUSTED['status'] == "") {
    $UNTRUSTED['status'] = "Y";
}
if ($UNTRUSTED['alterations'] == "Y") {
    $alterations_sql = "auto_invite='" . filter_sql($UNTRUSTED['auto_invite']) . "',show_arrival='" . filter_sql($UNTRUSTED['show_arrival_new']) . "',user_alert='" . filter_sql($UNTRUSTED['user_alert_new']) . "',typing_alert='" . filter_sql($UNTRUSTED['typing_alert_new']) . "',";
}
if ($UNTRUSTED['status'] == "N") {
    $query = "UPDATE livehelp_users set " . $alterations_sql . "isonline='N',lastaction='{$rightnow}',status='offline',auto_invite='N' WHERE sessionid='" . $identity['SESSIONID'] . "'";
    $mydatabase->query($query);
}
if ($UNTRUSTED['status'] == "Y") {
    $query = "UPDATE livehelp_users set " . $alterations_sql . "isonline='Y',lastaction='{$rightnow}',status='chat' WHERE sessionid='" . $identity['SESSIONID'] . "'";
    $mydatabase->query($query);
}
$query = "SELECT * FROM livehelp_users WHERE sessionid='" . $identity['SESSIONID'] . "'";
$data = $mydatabase->query($query);
$row = $data->fetchRow(DB_FETCHMODE_ASSOC);
$offline = "  ";
$online = "  ";
$show_arrival = "  ";
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:admin_rooms.php


示例17: while

 $counter = 0;
 while (empty($gen_peer_public_key) == FALSE) {
     if ($counter > 50) {
         // Too many loops for peers, something is wrong or peer
         // is giving out garbage information, break from loop
         modify_peer_grade($ip_address, $domain, $subfolder, $port_number, 5);
         break;
     }
     $gen_peer_public_key = find_string("-----public_key{$match_number}=", "-----join{$match_number}", $poll_peer);
     $gen_peer_join_peer_list = filter_sql(find_string("-----join{$match_number}=", "-----last{$match_number}", $poll_peer));
     $gen_peer_last_generation = filter_sql(find_string("-----last{$match_number}=", "-----ip{$match_number}", $poll_peer));
     $gen_peer_IP = filter_sql(find_string("-----ip{$match_number}=", "-----END{$match_number}", $poll_peer));
     $gen_peer_public_key = filter_sql(base64_decode($gen_peer_public_key));
     if (empty($gen_peer_last_generation) == TRUE) {
         // Old format compatible
         $gen_peer_last_generation = filter_sql(find_string("-----last{$match_number}=", "-----END{$match_number}", $poll_peer));
     }
     //Check if this public key is already in our peer list
     $public_key_match = mysql_result(mysql_query("SELECT * FROM `generating_peer_list` WHERE `public_key` = '{$gen_peer_public_key}' LIMIT 1"), 0, 0);
     //Check if a duplicate election time exist
     $time_elected_match = mysql_result(mysql_query("SELECT * FROM `generating_peer_list` WHERE `join_peer_list` = '{$gen_peer_join_peer_list}' LIMIT 1"), 0, 1);
     if (empty($public_key_match) == TRUE && empty($time_elected_match) == TRUE) {
         // No match in database to this public key
         if (strlen($gen_peer_public_key) > 256 && empty($gen_peer_public_key) == FALSE && $gen_peer_join_peer_list <= $current_generation_cycle && $gen_peer_join_peer_list > TRANSACTION_EPOCH) {
             $sql = "INSERT INTO `generating_peer_list` (`public_key`,`join_peer_list`,`last_generation`,`IP_Address`)\n\t\t\t\t\tVALUES ('{$gen_peer_public_key}', '{$gen_peer_join_peer_list}', '{$gen_peer_last_generation}', '{$gen_peer_IP}')";
             mysql_query($sql);
         }
     }
     $counter++;
     $match_number++;
 }
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:genpeer.php


示例18: intval

    }
}
// remove a question
if ($UNTRUSTED['whatdo'] == "REMOVE") {
    $query = "DELETE FROM livehelp_qa WHERE recno=" . intval($UNTRUSTED['recno']);
    $mydatabase->query($query);
}
// re-order folders/questions.
if ($UNTRUSTED['whatdo'] == "REORDER") {
    $query = "SELECT * from livehelp_qa";
    $myarray = $mydatabase->query($query);
    while ($row = $myarray->fetchRow(DB_FETCHMODE_ASSOC)) {
        $lookingfor = "ordering__" . $row['recno'];
        if (isset($UNTRUSTED[$lookingfor])) {
            $value = $UNTRUSTED[$lookingfor];
            $query = "UPDATE livehelp_qa \n                 SET ordernum='" . filter_sql($value) . "' \n                 WHERE recno=" . intval($row['recno']);
            $mydatabase->query($query);
        }
    }
}
// get the depth and the path..
function depthof($id)
{
    global $mydatabase;
    $pathto = array();
    while ($id != 0) {
        $query = "SELECT * FROM livehelp_qa WHERE recno=" . intval($id);
        $children = $mydatabase->query($query);
        $row = $children->fetchRow(DB_FETCHMODE_ASSOC);
        array_push($pathto, $id);
        $id = $row['parent'];
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:qa.php


示例19: filter_sql

$row = $data->fetchRow(DB_FETCHMODE_ASSOC);
$isadminsetting = $row['isadmin'];
if ($isadminsetting != "Y") {
    print "You must be logged in with Admin rights in order to change/view security settings";
    exit;
}
?>
<body bgcolor=<?php 
echo $color_background;
?>
 onload=currentstatus();>
<center>
<table border=0 cellpadding=0 cellspacing=0 width=590>
<?php 
if (!empty($UNTRUSTED['goforit'])) {
    $query = "UPDATE livehelp_config set directoryid='" . filter_sql($UNTRUSTED['directoryid']) . "'";
    $mydatabase->query($query);
    $CSLH_Config['directoryid'] = $UNTRUSTED['directoryid'];
}
?>
<tr><td bgcolor=<?php 
echo $color_alt2;
?>
><b>Crafty Syntax Security Registration Information:</b></td></tr>
<tr><td bgcolor=<?php 
echo $color_alt1;
?>
><ul>
Security is <font color=990000><b>*VERY*</b></font> important to Crafty Syntax. 
Security vulnerabilities are found in open source programs on almost a weekly 
basis and not knowing about these vulnerabilities can be catastrophic to your
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:31,代码来源:registerit.php


示例20: reset

    $query = "TRUNCATE TABLE `livehelp_smilies`";
    $mydatabase->query($query);
    // go though post vars
    reset($_POST);
    while (list($key, $val) = each($_POST)) {
        $arraysl = explode("_", $key);
        // if  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP filter_string函数代码示例发布时间:2022-05-15
下一篇:
PHP filter_set_local_state函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap