Advertisement
Kiporralixo

Untitled

Feb 12th, 2018
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. function sintaxy_senha($var){ // função para verificação de senha, só aceitará caractees (az) (AZ) (01) (.:) (-_)
  2. $parrern = "/[^a-zA-Z0-9.-:_=@-]{4,20}$/"; // definindo o tipo de entrada valida
  3. if(preg_match($parrern,$var) == TRUE){
  4. return $valor='sim';
  5. }else{
  6. return $valor='não';
  7. }
  8. }
  9.  
  10. // funcao de login
  11.  
  12. public function fazer_login($usuario){
  13. try{
  14. $query = "SELECT * FROM usuarios WHERE nome = :nome AND senha = :senha";
  15. $this->Selecionar = $this->Conn->prepare($query);
  16. $this->Selecionar->bindValue(':nome' , $usuario->getNome() , PDO::PARAM_STR);
  17. $this->Selecionar->bindValue(':senha', $usuario->getSenha(), PDO::PARAM_STR);
  18. $this->Selecionar->execute();
  19. if($this->Selecionar->rowCount() == 1){
  20. return $this->Selecionar->fetch(PDO::FETCH_ASSOC);
  21. }else{
  22. return false;
  23. }
  24. } catch (PDOException $ex) {
  25. exibeMensagens("Erro ao consultar. {$ex->getMessage()}", WS_ERROR);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement