Experimenta fazer do seguinte modo: - login.asp <%
dsn = "DBQ=" & Server.Mappath("dados.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"
%>
<%
response.buffer = true
'decleration
dim useraction
dim conn,dsn,rs,sql
'if the user submit the form
useraction = request("action")
select case useraction
case "login"
email = request.form("email")
senha = request.form("senha")
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open dsn
SQL = "select * from membros where email='"& email &"' and senha='"& senha & "'"
rs.open sql,conn
if rs.eof and rs.bof then
response.write "<center>Usuário ou Senha incorretos! Por favor, cadastre-se!</center>"
else
session("auth") = 1
session("id") = rs("id")
session("apelido") = rs("apelido")
response.redirect "main.asp"
end if
end select
%>
<html>
<head>
<title>Chat Canoas</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="http://www.chatcanoas.pop.com.br/styles.css" rel="stylesheet" type="text/css">
<link href="http://www.chatcanoas.pop.com.br/favicon.ico" rel="shortcut icon">
</head>
<body topmargin="0">
<script language="JavaScript">
<!-- Este script e muito mais você encontra GRÁTIS em -->
<!-- Super JavaScripts - http://www.superjavascripts.kit.net -->
<!--
function checkFields() {
if (document.formulario.email.value == "") {
alert("Digite seu e-mail");
formulario.email.focus();
return false;
}
if (document.formulario.email.value.indexOf("@", 0) == -1 || document.formulario.email.value.indexOf(".", 0) == -1 || document.formulario.email.value.length <= 10) {
alert("Digite um e-mail válido");
formulario.email.focus();
return false;
}
if (document.formulario.senha.value == "") {
alert("Digite sua senha");
formulario.senha.focus();
return false;
}
}
// -->
</script>
<form name="formulario" action="login.asp?action=login" method="post" onsubmit="return checkFields()">
<table align="center" width="135" border="0" bordercolor="#191919" cellspacing="2" cellpadding="1" class="bg1">
<tr>
<td align="center" colspan="2"><b>Login</b></td>
</tr>
<tr>
<td align="right">Email:</td>
<td><input type="text" name="email" size="10" maxlength="50"></td>
</tr>
<tr>
<td align="right">Senha:</td>
<td><input type="password" name="senha" size="10" maxlength="8"></td>
</tr>
<tr>
<td align="center" colspan="2"><input name="invisivel" type="checkbox" value="1" class="no"> Invisível <input class="botao" type="submit" value="Entrar"></td>
</tr>
<tr valign="top"><td align="center" colspan="2"> <img src="../assets/imagens/menu_seta.gif" border="0" width="5" height="5"> <a href="esquecisenha.htm">Esqueci senha</a></td></tr>
</table>
</form>
<p align="center"><a href="reg.asp">Você precisa estar cadastrado para acessar diversas áreas do site.</a></p>
</body>
</html>
- main.asp
<%
if session("auth") <> 1 then
response.write "acesso negado"
else
%><%
dim db,rs,sqltop5,sqleventos,sqlniver
set db = Server.CreateObject("ADODB.Connection")
db.Open "provider=microsoft.jet.oledb.4.0;data source="& server.mappath("dados.mdb")
dim i,cor, data_atual
i=0
data_atual=Date
%>
<html>
<head>
<title>Chat Canoas</title>
<base href="http://www.chatcanoas.pop.com.br/">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles.css" rel="stylesheet" type="text/css">
<link href="favicon.ico" rel="shortcut icon">
</head>
<body topmargin="0">
<table align="center" border="0" cellspacing="0" cellpadding="1" width="100%">
<tr valign="top">
<td width="25%">IP: <%Response.Write(Request.ServerVariables("REMOTE_ADDR"))%></td>
<td width="50%">Seja bem vindo <%If Session("auth") = 1 Then%><%=session("apelido")%></td>
<td width="13%"><a href="perfil.asp?id=<%=session("id")%>">Meu Perfil</a></td>
<td width="12%"><a href="logout.asp">Logout</a></td>
<%else%>Visitante</td>
<td width="25%"><a href="adduser.htm">cadastro</a> • <a href="login.htm">login</a></td><%end if%>
</tr>
</table>
</body></html><%end if%> Abraços e boa sorte! CIA :D