Buat Function Anti Inject PHP
Asskum
Berikut kode nya silahkan di salin..
function clean($str) {
$str = @trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
function anti_injection($data){
$filter = mysql_real_escape_string(stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES ))));
return $filter;
}
?>
Simpan kode di atas berinama
func.phpbonus function pencarian atau tag keyword silahkan di gasak juga
//copy code
<?php
function gettags($text){
$tags = explode(" ",str_replace(',','',$text));
foreach($tags as $key => $value)
$show .= $value.',';
return $show;
}
function tags($text){
$tags = explode(",",$text);
foreach($tags as $key => $value)
$show .= '<a href="search.php?q='.$value.'" title="Tags artikel '.$value.'">'.$value.'</a>,';
return $show;
}
?>
Selesai post kali ini wassalam
Back to posts
hmm.. baru tahu yg kek ginian. nice post sob