$hostname = "mysql01.rclip.hospedagemdesites.ws"; //$hostname = "186.202.152.242"; $username = "rclip"; $password = "rcliptt0015"; // $password = "success0014"; $dbName = "rclip"; #DADOS GERAIS DE CONFIGURA��O $url_galerias = "http://www.rclip.com.br/pictures/galerias/"; $url_servidor = "/home/audicomunicacao/www/_torratorra"; $url_website= "www.rclip.com.br"; $name_pictures = "torratorra"; $url_pictures = "http://www.rclip.com.br"; $cor_conteudo = "NAO"; $status_inicial = 1; $email_remetente = "controle@rclip.com.br"; $email_remetente_logo = "http://www.rclip.com.br/pictures/rclip_logo360.png"; #FIM DA CONFIGURA��O $id_adm = 1; $id_atendimento = 2; $id_financeiro = 3; $id_entregador = 4; $usuario_obs_materiais = 8; #VALORES / CALCULOS $val_psw = 250; $passaporte = 167; mysql_connect($hostname, $username, $password) or die ("Nao pude conectar"); mysql_select_db( "$dbName") or die( "Nao pude selecionar o banco de dados"); session_start(); function preparaURL($str) { $str = strtolower($str); $str = preg_replace('/[�����]/ui', 'a', $str); $str = preg_replace('/[����]/ui', 'e', $str); $str = preg_replace('/[����]/ui', 'i', $str); $str = preg_replace('/[�����]/ui', 'o', $str); $str = preg_replace('/[����]/ui', 'u', $str); $str = preg_replace('/[�]/ui', 'c', $str); // $str = preg_replace('/[,(),;:|!"#$%&/=?~^><��-]/', '_', $str); $str = preg_replace('/[^a-z0-9]/i', '-', $str); $str = preg_replace('/_+/', '-', $str); // ideia do Bacco :) return $str; } function AntiSqlInjection1($recebe) // GET { // Verifica a configura��o se "magic_quotes_gpc" esta setado, caso n�o esteja aplicamos o addslashes if (!get_magic_quotes_gpc) { addslashes($recebe); } // Tirando espa�os $recebe = trim($recebe); // Limpamos as tags HTML $recebe = strip_tags($recebe); // Procuramos as palavras reservadas sql e deletamos $recebe = preg_replace(sql_regcase("/(from|select|insert|update|delete|where|show tables|alter table|drop database|destroy|table|and|or|alter|drop|database|union|in|all|TABLE_NAME|1=1|INFORMATION_SCHEMA|like|COLUMNS|VALUES|between|view|inner join|left join|right join|Content-Type:|bcc:|cc:|Autoreply:|ftp|having|count|min|max|sum|(|)|create|applet|order by|group by|<|>|script|iframe|onload|javascript|alert|onmouseover|load|change)/"),'', $recebe); return $recebe; } function AntiSqlInjection2($recebe) // POST { // Verifica a configura��o se "magic_quotes_gpc" esta setado, caso n�o esteja aplicamos o addslashes if (!get_magic_quotes_gpc) { addslashes($recebe); } // Tirando espa�os $recebe = trim($recebe); // Limpamos as tags HTML $recebe = strip_tags($recebe); // Procuramos as palavras reservadas sql e deletamos $recebe = preg_replace(sql_regcase("/(from|select|insert|update|delete|where|show tables|alter table|drop database|destroy|table|database|union|TABLE_NAME|1=1|INFORMATION_SCHEMA|like|COLUMNS|VALUES|between|view|inner join|left join|right join|Content-Type:|bcc:|cc:|Autoreply:|ftp|having|create|applet|order by|group by|script|iframe|onload|javascript|alert|onmouseover)/"),'', $recebe); return $recebe; } function AntiSqlInjection3($recebe) // TEXTOS PERSONALIZADOS { // Verifica a configura��o se "magic_quotes_gpc" esta setado, caso n�o esteja aplicamos o addslashes if (!get_magic_quotes_gpc) { addslashes($recebe); } // Tirando espa�os $recebe = trim($recebe); // Procuramos as palavras reservadas sql e deletamos $recebe = preg_replace(sql_regcase("/(from|select|insert|update|delete|where|show tables|alter table|drop database|destroy|table|database|union|TABLE_NAME|1=1|INFORMATION_SCHEMA|like|COLUMNS|VALUES|between|view|inner join|left join|right join|Content-Type:|bcc:|cc:|Autoreply:|ftp|having|create|applet|order by|group by|script|iframe|onload|javascript|alert|onmouseover)/"),'', $recebe); return $recebe; } class StManage { function convertStrings($String){ $Separador = "-"; $String = trim($String); //Removendo espa�os do inicio e do fim da string $String = strtolower($String); //Convertendo a string para min�sculas $String = strip_tags($String); //Retirando as tags HTML e PHP da string $String = eregi_replace("[[:space:]]", $Separador, $String); //Substituindo todos os espa�os por $Separador $String = eregi_replace("[��]", "c", $String); //Substituindo caracteres especiais pela letra respectiva $String = eregi_replace("[����������]", "a", $String); $String = eregi_replace("[��������]", "e", $String); $String = eregi_replace("[��������]", "i", $String); $String = eregi_replace("[����������]", "o", $String); $String = eregi_replace("[��������]", "u", $String); $String = eregi_replace("(\()|(\))", $Separador, $String); //Substituindo outros caracteres por "$Separador" $String = eregi_replace("(\/)|(\\\)", $Separador, $String); $String = eregi_replace("(\[)|(\])", $Separador, $String); $String = eregi_replace("[@#\$%&\*\+=\|�]", $Separador, $String); $String = eregi_replace("[;:'\"<>,\.?!_-]", $Separador, $String); $String = eregi_replace("[��]", $Separador, $String); $String = eregi_replace("(�)+", $Separador, $String); $String = eregi_replace("[`�~^�]", $Separador, $String); $String = eregi_replace("($Separador)+", $Separador, $String); //Removendo o excesso de "$Separador" por apenas um $String = substr($String, 0, 100); //Quebrando a string para um tamanho pr�-definido $String = eregi_replace("(^($Separador)+)|(($Separador)+$)", "", $String); //Removendo o "$Separador" do inicio e fim da string return $String; } } ?>