欧美国产另类久热|951超碰伊人久久|伊人影视久久久久|色婷婷亚洲小电影|色东京热69XX|婷婷玖玖深爱网|加勒比东京热网站|无码A级毛片在线观看|一级a毛一级a看|中文字幕人妻欧美

php快速查找數(shù)據(jù)庫中惡意代碼的方法
來源:易賢網(wǎng) 閱讀:1292 次 日期:2015-04-03 10:15:41
溫馨提示:易賢網(wǎng)小編為您整理了“php快速查找數(shù)據(jù)庫中惡意代碼的方法”,方便廣大網(wǎng)友查閱!

本文實(shí)例講述了php快速查找數(shù)據(jù)庫中惡意代碼的方法。分享給大家供大家參考。具體如下:

  數(shù)據(jù)庫被輸入惡意代碼,為了保證你的數(shù)據(jù)庫的安全,你必須得小心去清理。有了下面一個(gè)超級(jí)方便的功能,即可快速清除數(shù)據(jù)庫惡意代碼。

function cleanInput($input) {

$search = array(

, // Strip out javascript

, // Strip out HTML tags

'@

]*?>.*?

@siU', // Strip style tags properly

// Strip multi-line comments

);

$output = preg_replace($search, '', $input);

return $output;

}

function sanitize($input) {

if (is_array($input)) {

foreach($input as $var=>$val) {

$output[$var] = sanitize($val);

}

}

else {

if (get_magic_quotes_gpc()) {

$input = stripslashes($input);

}

$input = cleanInput($input);

$output = mysql_real_escape_string($input);

}

return $output;

}

// Usage:

$bad_string = "Hi! It's a good day!";

$good_string = sanitize($bad_string);

// $good_string returns "Hi! It\'s a good day!"

// Also use for getting POST/GET variables

$_POST = sanitize($_POST);

$_GET = sanitize($_GET);

更多信息請(qǐng)查看IT技術(shù)專欄

更多信息請(qǐng)查看網(wǎng)絡(luò)編程
易賢網(wǎng)手機(jī)網(wǎng)站地址:php快速查找數(shù)據(jù)庫中惡意代碼的方法
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn)

版權(quán)所有:易賢網(wǎng)