Ir para conteúdo
Fórum Script Brasil

Julio Cezar 2

Membros
  • Total de itens

    3
  • Registro em

  • Última visita

Sobre Julio Cezar 2

Julio Cezar 2's Achievements

0

Reputação

  1. Problema que não sei como funciona, é tipico caso de 'or'1 eliminando somente este problema na validação já resolveria meu problema a questão que não sei como fazer isso com o código acima. To curtindo d++ este fórum, muito dinâmico
  2. na verdade entendo pouco muito pouco de PHP, por isso estou pedindo ajuda ate onde pesquisei é esta linha q esta deixando vulnerável: if ($acao == "validar_acesso"){ if ($edt_login == "" || $edt_senha == ""){ echo "&lt;script>window.alert('ERRO. Preenchimento obrigatorio Login / Senha Obrigatorio');</script>"; echo "&lt;script>window.location='index.php';</script>"; } else { $sql="select * from usuario where (login='$edt_login') and (senha='$edt_senha')"; $exe=mysql_query($sql); $num=mysql_num_rows($exe); if ($num <=0){
  3. Painel de controle, de um software. Como fazer neste código para eliminar sql injection. <?php // *************************************************************** // *************************************************************** session_start(); include('conexao.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo $titulo;?></title> <link href="netplus.css" rel="stylesheet" type="text/css" /> <style type="text/css"> body { background-color: #EAD270; } </style> &lt;script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> &lt;script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script> <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" /> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="669" border="0" align="center"> <tr> <td colspan="3"><img src="imagens/cinema3.jpg" width="661" height="166" /></td> </tr> <tr> <td colspan="3"><table width="652" border="0" align="center"> <tr align="center" class="relatorio1"> <td width="135" class="txtAlertaBOX">Principal</td> <td width="187"><a href="index_sobre.php">Sobre o Sistema</a></td> <td width="174"><a href="index_downloads.php">Area de Downloads</a></td> <td width="138"><a href="index_contato.php">Contato</a></td> </tr> </table></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td width="62">&nbsp;</td> <td width="62">&nbsp;</td> <td width="531">&nbsp;</td> </tr> <tr> <td colspan="3" align="center"><span class="txtAlertaBOX">Acesso ao CSPADM </span><br /> <table width="430" border="1" align="center"> <tr> <td align="right"><form id="form1" name="form1" method="post" action="?acao=validar_acesso"> <table width="339" border="0" align="center" cellpadding="2" cellspacing="2"> <tr> <td width="115">&nbsp;</td> <td width="214">&nbsp;</td> </tr> <tr> <td class="txtBOX"><div align="right">Usuario:</div></td> <td><label for="edt_login"></label> <input type="text" name="edt_login" id="edt_login" /></td> </tr> <tr> <td class="txtBOX"><div align="right">Senha:</div></td> <td><label for="edt_senha"></label> <input type="password" name="edt_senha" id="edt_senha" /></td> </tr> <tr> <td class="txtBOX">&nbsp;</td> <td><input name="Validar" type="submit" class="txtBOX" id="Validar" value="Acessar o Sistema" /></td> </tr> </table> </form> <span class="edtBOX">Desenvolvido por <a href="mailto:julia@hotmail.com">JulianoSMI</a></span> </table></td> </tr> <tr> <td colspan="3" align="center" class="edtBOX">&nbsp;</td> </tr> <tr> <td colspan="3" align="center" class="edtBOX">&nbsp;</td> </tr> <tr> <td colspan="3" align="center" class="edtBOX">&nbsp;</td> </tr> <tr> <td colspan="3" align="center" class="edtBOX">&nbsp;</td> </tr> <tr> <td colspan="3" align="center" class="edtBOX">&nbsp;</td> </tr> <tr> <td colspan="3" align="center" class="edtBOX">&nbsp;</td> </tr> <tr> <td colspan="3" align="center" class="edtBOX">Todos os direitos Reservados.</td> </tr> </table> <?php if ($acao == "validar_acesso"){ if ($edt_login == "" || $edt_senha == ""){ echo "&lt;script>window.alert('ERRO. Preenchimento obrigatorio Login / Senha Obrigatorio');</script>"; echo "&lt;script>window.location='index.php';</script>"; } else { $sql="select * from usuario where (login='$edt_login') and (senha='$edt_senha')"; $exe=mysql_query($sql); $num=mysql_num_rows($exe); if ($num <=0){ $existe_revenda=0; } else { $existe_revenda=1; $tmp=mysql_fetch_array($exe); $usuario_situacao=$tmp[situacao]; if ($usuario_situacao == 0){ echo "&lt;script>window.alert('ERRO. Login Inativo. Favor contactar o Administrador');</script>"; echo "&lt;script>window.location='index.php';</script>"; } if ($usuario_situacao == 9){ echo "&lt;script>window.alert('ATENCAO. Login Bloqueado. Favor contactar o Administrador');</script>"; echo "&lt;script>window.location='index.php';</script>"; } if ($usuario_situacao == 1){ $_SESSION['acesso_idusuario']=$tmp[idusuario]; $_SESSION['acesso_idempresa']=$tmp[idempresa]; $_SESSION['acesso_admin']=$tmp[admin]; $_SESSION['acesso_revenda']=$tmp[revenda]; $idempresa=$tmp[idempresa]; $sql="select situacao from empresa where idempresa='$idempresa' and situacao=1"; $exe=mysql_query($sql); $num=mysql_num_rows($exe); if ($num >0){ echo "&lt;script>window.location='principal.php';</script>"; } else { echo "&lt;script>window.alert('ERRO. Seu acesso ao sistema esta temporariamente bloqueado. Favor contactar o Administrador do Sistema');</script>"; echo "&lt;script>window.location='index.php';</script>"; } } } } if ($existe_revenda == 0){ $sql="select * from csp_user where (name='$edt_login') and (password='$edt_senha')"; $exe=mysql_query($sql); $num=mysql_num_rows($exe); if ($num <=0){ echo "&lt;script>window.alert('ERRO. Acesso não permitido');</script>"; echo "&lt;script>window.location='index.php';</script>"; } else { $tmp=mysql_fetch_array($exe); $usuario_situacao=$tmp[enabled]; if ($usuario_situacao == "false"){ echo "&lt;script>window.alert('ERRO. Login Inativo. Favor contactar o seu Revendedor');</script>"; echo "&lt;script>window.location='index.php';</script>"; } else { $_SESSION['acesso_idcliente']=$tmp[id]; $_SESSION['acesso_usuario']=$tmp[name]; $_SESSION['acesso_idempresa']=$tmp[idempresa]; echo "&lt;script>window.location='portalcliente.php';</script>"; } } } } ?> &lt;script type="text/javascript"> var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1"); var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1"); </script> </body> </html>
×
×
  • Criar Novo...