Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function protect( &$str ) {
- if( !is_array( $str ) ) {
- $str = preg_replace( '/(from|select|insert|delete|where|drop|union|order|update|database)/i', '', $str );
- $str = preg_replace( '/(<|<)?script(/?(>|>(.*))?)/i', '', $str );
- $tbl = get_html_translation_table( HTML_ENTITIES );
- $tbl = array_flip( $tbl );
- $str = addslashes( $str );
- $str = strip_tags( $str );
- return strtr( $str, $tbl );
- } else {
- return array_filter( $str, "protect" );
- } }
- session_start();
- $login = protect($_SESSION['login']));
- $senha = protect($_SESSION['senha']));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement