//防止注入
代码如下 | 复制代码 |
function inject_check($sql_str) { //防止注入 $check = eregi('select|insert|update|delete|'|/*|*|../|./|union|into|load_file|outfile', $sql_str); if ($check) { echo "输入非法注入内容!"; exit (); } else { return $sql_str; } } |
//检查来路
代码如下 | 复制代码 |
function checkurl() { //检查来路 if (preg_replace("/https教程?://([^:/]+).*/i", "1", $_server['http_referer']) !== preg_replace("/([^:]+).*/", "1", $_server['http_host'])) { header("location: http://www.111com.net"); exit(); } } |