Anti-SQL injection-primary method php code
// Anti-injection function inject_check ($ SQL _str) {$ check = eregi ('select | insert | update | delete | \ * | \/\ * | \ '| \. \. \/| \. \/| UNION | into | load_file | outfile ', $ SQL _str); if ($ check) {page_href ("http ://". $ _ SERVER ['http _ host']. "/home/sitemap. php "); exit () ;}else {return $ SQL _str ;}// anti-XSS function inject_check2 ($ SQL _str) {$ check = eregi ('javascript | vbscript | expression | applet | meta | xml | blink | link | style | script | embed | object | iframe | frame | frameset | ilayer | layer | bgsound | title | base | onabort | onactivate | onafterprint | onafterupdate | region | onbeforeeditfocus | region | onbeforeprint | region | onbeforeupdate | onblur | onbounce | oncellchange | onchange | onclick | oncontextmenu | oncontrolselect | oncopy | oncut | region | ondatasetchanged | region | ondrag | ondragend | ondragenter | region | ondragover | ondragstart | ondrop | onerror | onerrorupdate | onfilterchange | onfinish | onfocus | onfocusin | alert | onhelp | onkeydown | onkeypress | onkeyup | enabled | onload | enabled | onmousedown | onmouseenter | enabled | onmousemove | onmouseout | onmouseover | onmouseup | onmousewheel | onmove | region | onmovestart | onpaste | onpropertychange | region | onreset | onresize | onresizeend | region | onrowenter | region | onscroll | onselect | onselectionchange | onselectstart | onstart | onstop | onsubmit | onunload ', $ SQL _str); if ($ check) {page_href ("http ://". $ _ SERVER ['http _ host']. "/home/sitemap. php "); exit () ;}else {// return $ SQL _str ;}}