Ir para conteúdo
Fórum Script Brasil

Caiera

Membros
  • Total de itens

    11
  • Registro em

  • Última visita

Sobre Caiera

Últimos Visitantes

642 visualizações

Caiera's Achievements

0

Reputação

  1. Exibe a mesma coisa, sem alterações. Abri pelo notepad++ em um novo arquivo, coloquei UTF-8 sem BOM, mas continua o mesmo erro.
  2. Meu config.php : <?php $host = 'localhost'; $dbname = 'db_critiquei'; $username = 'root'; $password = ''; $conexao = new PDO ( "mysql:host={$host}; dbname={$dbname}", $username, $password ); $conexao->exec("set names utf8"); ?>
  3. Sim criticas_adm.php : <?php require "config.php"; session_start(); //Caso o usuário não esteja autenticado, limpa os dados e redireciona if (!isset ($_SESSION['login']) and !isset ($_SESSION['senha'])) { //Destrói session_destroy(); //Limpa unset ($_SESSION['login']); unset ($_SESSION['senha']); //Redireciona para a página de autenticação header('location:../conta/login.php'); } //$seunome = ""; //$_SESSION['login'] = $seunome; ?> <!DOCTYPE html> <html lang="pt-br"> <head> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <title>Área Administrativa</title> <!-- Bootstrap --> <link href="../assets/css/bootstrap.min.css" rel="stylesheet"> <link href="../assets/css/adm.css" rel="stylesheet"> <!-- Funções javascript --> <script src="../assets/js/funcoes.js"></script> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body class="fundopg"> <!-- Topo --> <div class="container fundodiv"> <div class="row"> <div class="col-md-12"> <h1 class="tith1">Página administrativa</h1> </div> </div> </html> login.php : <!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <title>Fazer login</title> <!-- Bootstrap --> <link href="../assets/css/bootstrap.min.css" rel="stylesheet"> <link href="../assets/css/adm.css" rel="stylesheet"> <!-- Funções javascript --> <script src="../assets/js/funcoes.js"></script> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body class="fundopg"> <!-- Topo --> <div class="container fundodiv"> <div class="row"> <div class="col-md-12"> <!-- Form login --> <h1 class="titulo">Entre com o usuário e senha.</h1> <form id="frmLogin" action="../adm/funcoes.php" method="POST" accept-charset="uft-8"> <div class="form-group"> <label for="InputNome" class="Oswald">Usuário</label> <input name="txtUsuario" type="text" class="form-control" id="InputNome" onclick="javascript:FLimparInputNome()"> </div> <div class="form-group"> <label for="InputSenha" class="Oswald">Senha</label> <input name="txtSenha" type="password" class="form-control" id="InputSenha" onclick="javascript:FLimparInputSenha()"> </div> <input type="hidden" name="txtControle" value="0" /> <button class="btEntrar" onclick="javascript:FLogin()">Acessar</a> </form> <!-- /Form login --> </div> </div> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="../assets/js/bootstrap.min.js"></script> </body> </html> funcoes.php /* formulario login */ if($vControle == 0) { $vUsuario = $_POST["txtUsuario"]; $vSenha = $_POST["txtSenha"]; $sqlLogin = "SELECT * FROM tbl_admins WHERE login='$vUsuario' AND senha='$vSenha'"; $rsUsuarios = $conexao->query($sqlLogin) or die (print_r($conexao->errorInfo(), true)); $totrec = $rsUsuarios->fetchColumn(); if($totrec>0) { $js = "<script type='text/javascript'>"; $js = $js . "window.location.href='criticas_adm.php'"; $js = $js . "</script>"; echo $js; } else{ $js = "<script type='text/javascript'>"; $js = $js . "window.location.href='../conta/login.php'"; $js = $js . "</script>"; echo $js; } } funcoes.js : function FLogin() { v_usuario = document.getElementById("InputNome").value; v_senha = document.getElementById("InputSenha").value; v_msg = "Digite uma informacao."; if(v_usuario.length < 1 || v_usuario == "Campo em branco.") { document.getElementById("InputNome").value = v_msg; return false; } else if(v_senha.length < 1 || v_senha == "Campo em branco.") { document.getElementById("InputSenha").value = v_msg; return false; } else { document.getElementById("frmLogin").submit(); } } function FLimparInputNome() { document.getElementById("InputNome").value = ''; } function FLimparInputSenha() { document.getElementById("InputSenha").value = ''; }
  4. <?php require "config.php"; session_start(); //Caso o usuário não esteja autenticado, limpa os dados e redireciona if (!isset ($_SESSION['login']) and !isset ($_SESSION['senha'])) { //Destrói session_destroy(); //Limpa unset ($_SESSION['login']); unset ($_SESSION['senha']); //Redireciona para a página de autenticação header('location:../conta/login.php'); } //$seunome = ""; //$_SESSION['login'] = $seunome; ?>
  5. Boa noite, Está ocorrendo esse erro : Parse error: syntax error, unexpected 'if' (T_IF) in C:\xampp\htdocs\mist\adm\criticas_adm.php on line 6 Nessa parte de código: <?php require "config.php"; session_start(); //Caso o usuário não esteja autenticado, limpa os dados e redireciona if !isset ($_SESSION['login']) and !isset ($_SESSION['senha']) { //Destrói session_destroy(); //Limpa unset ($_SESSION['login']); unset ($_SESSION['senha']); //Redireciona para a página de autenticação header('location:login.php'); } //$seunome = ""; //$_SESSION['login'] = $seunome; ?> Alguém pode me ajudar ?
  6. Não acredito que era só isso, obrigado amigo.
  7. Boa noite, Quando fui tentar atualizar um campo em meu DB... UPDATE tbl_criticas SET id_admin = '', titulo = 'editado', conteudo = 'O Conteudo foi editado.', imagem = 'teste.png', WHERE id = 21; Me encontrei com esse erro : #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE id = 21' at line 1 Sou meio novo nesse fórum apesar de já ter essa conta a algum tempo, não sei se postei algo indevido, mas estou ficando doido já com esse simples problema que já leva algumas horas. Alguém por favor pode ajudar? Replico as respostas ao amanhecer. Obrigado desde já pela atenção.
×
×
  • Criar Novo...