Jump to content
Fórum Script Brasil
  • 0

Session


Kinhabeu

Question

Oi pessoal

Coloquei um script na minha pagina para verificação de senha

arquivo auth.php

<?php

if ($_POST && !$_SESSION['AUTH']) {

$QY=SELECT usuario,senha FROM senhas where usuario='{$_POST['usuario]}' and senha='{$_POST['senha']}'";

$rs=$db->Execute($QY);

if ($rs->EOF) {

$ERRO=USUARIO OU SENHA INVALIDOS";

include("login.php");

exit();

}

$_SESSION['AUTH]=1;

} elseif (!$_SESSION['AUTH']) {

$ERRO="INFORMAR USUARIO E SENHA";

include("login.php");

exit();

}

?>

arquivo que sera acessado

<?php

session_start();

include_once("config.inc.php");

include_once("includes/cadlib.inc.php");

include("auth.php");

.......

?>

O primeiro projeto que eu usei deu certo, mas agora em outro está dando o seguinte erro:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at C:\Inetpub\BaumerFinanc\administrativo\cadastro.php:2) in C:\Inetpub\BaumerFinanc\administrativo\cadastro.php on line 3

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at C:\Inetpub\BaumerFinanc\administrativo\cadastro.php:2) in C:\Inetpub\BaumerFinanc\administrativo\cadastro.php on line 3

alguém sabe o que eu tenho que fazer??????

Obrigada desde já

Erika

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Eu colocaria esa linha

$QY="SELECT usuario,senha FROM senhas where usuario='{$_POST['usuario']}' and senha={$_POST['senha]}'";

assim

$QY="SELECT usuario,senha FROM senhas where usuario='$_POST['usuario']' and senha=$_POST['senha]";

Da uma testada.

Ah! Veja se as variaveis globais estão habilitadas também.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      651.8k
×
×
  • Create New...