
mestre fyoda
Membros-
Total de itens
1.908 -
Registro em
-
Última visita
Tudo que mestre fyoda postou
-
eu fiz desse jeito e nada . O que esta de errado nisso ? Corria-o pra mim . <html> <head> <script language="JavaScript"> <!-- function abrir() { window.open ('sair.asp'); window.open ('deleta_usuarioonline.asp'); } //--> </script> </head> <!--#include file="users_online.asp"--> <body onunload="abrir()" onunload="deleta()" > </body> </html>
-
Como faço pra chamar o evento onunload duas vezes na body , dece jeito que esta so ta fazendo um onunload . Como faço pra executar os onunload ? <html> <head> <script language="JavaScript"> <!-- function abrir() { window.open ('sair.asp'); } //--> </script> <script language="JavaScript"> <!-- function deleta() { window.open ('deleta_usuarioonline.asp'); } //--> </script> </head> <body onunload="abrir()" onunload="deleta()" > </body> </html>
-
você tinha razao bareta , o erro estava ai . Grato a todos . Mas so tem um probleminha . Eu cadastrei um usuario e depois ele sumia . Será que ele esta sendo deletado pelo o script de usuarios online . No BD ele tem duas tabelas : - online - usuarios Deve ser por causa disso , de ter essas duas tabelas ? Eu teria que criar um outro banco de dados ?
-
ei dark0 , eu fiz o que você me disse e naõ deu certo , ele não está acessando onunload="window.location='sair.asp'" , porque quando loga , loga normalmente , quando clico no X (fechar da janela) , e abro a pagina novamente ele está logado . Ele deveria abrir a parte do formulario , a parte do else . No sair.asp , tem o Abandon Session .
-
Bareta , não esta abrindo nenhuma janela .
-
não da nenhum erro . Eu baixo o bd do site pra ver se deletou os dados mas não esta deletando , porque ? users_online <body onunload="window.location='deleta_usuarioonline.asp'"> <% Set Conexao = CreateObject("ADODB.CONNECTION") conStr ="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("dados.mdb") Conexao.Open ConStr agora=Time() ip=Request.ServerVariables("REMOTE_ADDR") If Session("login") = "" Then user="" Else user=Session("login") End If Sql="INSERT INTO online VALUES ('"&agora&"','"&ip&"','"&user&"')" Conexao.Execute(Sql) Sql = "SELECT DISTINCT ip FROM online" Set RS = Server.CreateObject("ADODB.Recordset") RS.open Sql,Conexao, 3, 3 If rs.EOF Then %> Nenhum usuario está online! <% else %> Existem <%=rs.recordcount%> online<BR> <% Sql1 = "SELECT DISTINCT ip FROM online WHERE user <> '' " Set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Sql1,Conexao, 3, 3 %> Sendo <%=rs1.recordcount%> membros e <%Sql2 = "SELECT DISTINCT ip FROM online WHERE user = '' " Set RS2 = Server.CreateObject("ADODB.Recordset") RS2.open Sql2,Conexao, 3, 3 %> <%=rs2.recordcount%> visitantes.<BR> <% Sql="Select * from online" Set rs3=Conexao.Execute(Sql) If rs1.EOF then %> <% else %> Os membros online são: <% While Not rs1.EOF %> <%=rs3("user")%>, <% rs1.MoveNext Wend End If End If %> </body> deleta_usuarioonline <% Set Conexao = CreateObject("ADODB.CONNECTION") conStr ="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("dados.mdb") Conexao.Open ConStr ip = Request.ServerVariables("REMOTE_ADDR") del = "DELETE agora, ip, user FROM online WHERE user="&user&" " conObj.execute(del) %>
-
quando o usuario não esta logo e tenta abrir esse link , ele cai no ele , caso você digite o login e senha correto ele cai no onunload e vai para sair.asp . Eu queria que ele entrace no IF Session("login") <> False Then . Como faço Pra acionar a pagina sair.asp só quando o usario clica no X da Janela Do Internet Explorer ?
-
Essa funcão onunload ela é ativada todas as vezes que eu digito o Login e Senha Correto , porque ?Não era pra acontecer isso. <% If Session("login") <> False Then Response.Write "Bem Vindo <b>"&Session("login")&"</b>" Else Response.Write "<form method=post action=validalogin.asp>" Response.Write "Login: <input type=text name=login size=15><br>" Response.Write "Senha: <input type=password name=senha size=15><BR>" Response.Write "<input type=submit value=Login!></form>" End If %> <html> <head> </head> <body onunload="window.location='sair.asp'"> </body> </html>
-
não é querer ser chato , mas gostaria do meu jeito .
-
Ele continua não deletando . <% Set Conexao = CreateObject("ADODB.CONNECTION") conStr ="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("dados.mdb") Conexao.Open ConStr ip=Request("ip") Sql="DELETE * FROM online where ip='"&ip&"'" Conexao.Execute(Sql) %>
-
eu fiz assim e não deletou ? Poderia me passar o jeito certo .
-
ei gente , cada vez que eu desconecto da Internet e entro no site ele soma + 1 . Por exemplo , ele estava com 5 usuarios online , eu fechava a tela e desconectava e depois conectava na InterNet ele somava + 1 usuario . Se eu não desconectar ele não soma + 1 usuario , entenderam . O que esta acontecendo . deleta_usuarioonline <% Set Conexao = CreateObject("ADODB.CONNECTION") conStr ="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("online") Conexao.Open ConStr Sql="DELETE * FROM online " Conexao.Execute(Sql) %>
-
eu presizo que alguém teste comigo , mas por enquanto tudo ok . Caso não volte a postar esta correto . Mas pode deixar que eu avizo que estar ok
-
de boa ,achei mais complicado. Se alguém puder me ajudar com o meu codigo , ficaria grato .
-
esta dando erro no site http://i.1asphost.com/comunidade/users_online.asp Eu já mechi no Avançados no InterNet Explorer , abilitei aparecer o erros e nada . <body onunload="window.location='deleta_usuarioonline.asp'"> <% Set Conexao = CreateObject("ADODB.CONNECTION") conStr ="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("dados") Conexao.Open ConStr agora=Time() ip=Request.ServerVariables("REMOTE_ADDR") If Session("login") = "" Then user="" Else user=Session("login") End If Sql="INSERT INTO online VALUES ('"&agora&"','"&ip&"','"&user&"')" Conexao.Execute(Sql) Sql = "SELECT DISTINCT ip FROM online" Set RS = Server.CreateObject("ADODB.Recordset") RS.open Sql,Conexao, 3, 3 If rs.EOF Then %> Nenhum usuario está online! <% else %> Existem <%=rs.recordcount%> online<BR> <% Sql1 = "SELECT DISTINCT ip FROM online WHERE user <> '' " Set RS1 = Server.CreateObject("ADODB.Recordset") RS1.open Sql1,Conexao, 3, 3 %> Sendo <%=rs1.recordcount%> membros e <%Sql2 = "SELECT DISTINCT ip FROM online WHERE user = '' " Set RS2 = Server.CreateObject("ADODB.Recordset") RS2.open Sql2,Conexao, 3, 3 %> <%=rs2.recordcount%> visitantes.<BR> <% Sql="Select * from online" Set rs3=Conexao.Execute(Sql) If rs1.EOF then %> <% else %> Os membros online são: <% While Not rs1.EOF %> <%=rs3("user")%>, <% rs1.MoveNext Wend End If End If %> </body>
-
valeu dark mas não era apenas esse erro , já concertei , grato
-
Agora eu substitui o checkbox por radio , reformulei o meu codigo mas continua dando erro : 404 Page not found nivel_acesso.asp <%@ Language=VBScript %> <%OPTION EXPLICIT%> <BODY> <FORM action="mudar_nivel.asp" method="Post" name=Form> <% Dim conn,rs,intCounter,intMod,rcolor set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("dados.mdb")) set rs = Server.CreateObject("ADODB.recordset") rs.Open "SELECT usuarios.id,usuarios.login, usuarios.nome , usuarios.nivel from usuarios order by usuarios.login", conn %> <center> <table width="647" border="1" cellpadding="0" cellspacing="0" height="43" style="border-collapse: collapse" bordercolor="#CCCCCC" class="TD"> <tr> <th align="left" bgcolor=#DFE19D width="392" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <b> <center>Selecione</center></b> <th align="left" bgcolor=#DFE19D width="179" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <b><font size="2" face="arial" class="TD"> <center>Login</center></font> </b> <td align="left" bgcolor=#DFE19D width="189" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <p align="center"><b><font size="2" face="arial" class="TD"> Nome</font></b></td> <td align="left" bgcolor=#DFE19D width="265" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <p align="center"><b><font size="2" face="arial" class="TD"> Status</font></b></td> </tr> <%intCounter=0%> <%do until rs.EOF%> <% intCounter=intCounter+1 intMod=intcounter mod 2 if intmod=0 then rcolor = "#c0c0c0" elseif intmod=1 then rcolor = "#FFFFFF" end if %> <tr> <td align="left" bgcolor=<%=rcolor%> width="392" height="20"> <font size="2" face="arial" color="BLACK" class="TD"> <width=35%> <input type="radio" name="Muda_Nivel" value="Adiministrador">Administrador <input type="radio" name="Muda_Nivel" value="Moderador" > Moderador <input type="radio" name="Muda_Nivel" value="Usuario" checked>Usuario</font> <td align="left" bgcolor=<%=rcolor%> width="113" height="20"> <font size="2" face="arial" color="BLACK" class="TD"> <center><%Response.Write (rs("login"))%></center> </font> <td align="center" bgcolor=<%=rcolor%> width="95" height="20"> <font size="2" face="arial" color="BLACK" class="TD"> <center> <%Response.Write(rs("nome"))%></center> </font> <td align="center" bgcolor=<%=rcolor%> width="21" height="20"> <font size="2" face="arial" color="BLACK" class="TD"> <center><%Response.Write(rs("nivel"))%></center> </font> <%rs.MoveNext%> </tr> <%loop SET rs=nothing set conn=nothing %> </table> <BR><BR> <input class="botao" type="submit" value="Mudar Nivel" name="B1"> </center> </form> </BODY> </html> mudar_nivel.asp <%@ Language=VBScript%> <% Option Explicit %> <% Dim intSno,intDelSno,conn,a intSno=Request("Muda_Nivel") set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("dados.mdb")) a=split(intSno,",") dim iLoop for iLoop=LBound(a) to UBound(a) intDelSno=Trim(a(iLoop)) conn.Execute "update from usuarios where id=" & intDelSno & "" next Response.Redirect "ViewDir.asp" conn.Close set conn=nothing %>
-
não entendi esse num_id , da onde ela saiu ?
-
acessem o http://i.1asphost.com/comunidade/nivel_acesso.asp . ele esta dando erro .
-
Microsoft JET Database Engine error '80040e07' Data type mismatch in criteria expression. /comunidade/mudar_nivel.asp, line 14 <%@ Language=VBScript %> <BODY> <FORM action="mudar_nivel.asp" method="Post" name=Form> <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("dados.mdb")) set rs = Server.CreateObject("ADODB.recordset") SQL = "select * from usuarios" RS.Open SQL,Conn,3,3 %> <table width="434" border="1" cellpadding="0" cellspacing="0" height="43" style="border-collapse: collapse" bordercolor="#CCCCCC"> <tr> <th align="left" bgcolor=#DFE19D width="121" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <b> Selecione</b> <th align="left" bgcolor=#DFE19D width="118" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <b><font size="2" face="arial"> Nome</font> </b> <td align="left" bgcolor=#DFE19D width="129" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <p align="center"><b><font size="2" face="arial"> Login</font></b></td> </tr> <%intCounter=0%> <%do until rs.EOF%> <% intCounter=intCounter+1 intMod=intcounter mod 2 if intmod=0 then rcolor = "#c0c0c0" elseif intmod=1 then rcolor = "#FFFFFF" end if %> <tr> <td align="left" bgcolor=<%=rcolor%> width="121" height="20"> <p align="right"> <font size="2" face="arial" color="BLACK"> <width=35%>Adiministrador<input type=CheckBox name=A value=<%=RS("nivel")%>><br> Moderador<input type=CheckBox name=M value=<%=RS("nivel")%>><br> Usurio<input type=CheckBox name=U value=<%=RS("nivel")%>><br> </font> <td align="left" bgcolor=<%=rcolor%> width="78" height="20"> <font size="2" face="arial" color="BLACK"> <%Response.Write (RS("nome"))%> </font> <td align="center" bgcolor=<%=rcolor%> width="127" height="20"> <font size="2" face="arial" color="BLACK"> <%Response.Write(RS("login"))%> </font> <%rs.MoveNext%> </font></tr> <% A = Request.Form("A") M = Request.Form("M") U = Request.Form("U") loop SET rs=nothing set conn=nothing %> <% If Request("A") = "on" Then strSQL = "UPDATE usuarios set nivel = '"&A&"'" conexao.Execute(strSQL) end if %> <% If Request("M") = "on" Then strSQL = "UPDATE usuarios set nivel = '"&M&"'" conexao.Execute(strSQL) end if %> <% If Request("U") = "on" Then strSQL = "UPDATE usuarios set nivel = '"&U&"'" conexao.Execute(strSQL) end if %> </table> <input type="submit" value="Atualizar Nivel" name="B1"> </form> </BODY> mudar_nivel.asp <%@ Language=VBScript%> <% intSno=Request("Delete") set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("dados.mdb")) id = Request("nivel") Set rs = conn.Execute("SELECT * FROM usuarios WHERE id = '"&id&"'") If rs.EOF Then Response.Write "O usurio no existe!!!" ElseIf rs("nivel") = "1" Then ' tire as aspas caso seja valor numrico no BD Response.Write "O man, no pode excluir usurios de nvel 1..." Else a=split(intSno,",") for iLoop=LBound(a) to UBound(a) intDelid=Trim(a(iLoop)) conn.Execute "update from usuarios where id = " & id & " " next Response.Write "O nivel do Usuario foi modificado" End If rs.Close Set rs = Nothing %>
-
Estranho , eu coloquei pra avizar o tipo de erro que da , mas não esta dando nenhum erro . aqui esta o link http://i.1asphost.com/comunidade/nivel_acesso.asp . formulario para alterar o nivel <%@ Language=VBScript %> <BODY> <FORM action="mudar_nivel.asp" method="Post" name=Form> <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("dados.mdb")) set rs = Server.CreateObject("ADODB.recordset") SQL = "select * from usuarios" RS.Open SQL,Conn,3,3 %> <table width="434" border="1" cellpadding="0" cellspacing="0" height="43" style="border-collapse: collapse" bordercolor="#CCCCCC"> <tr> <th align="left" bgcolor=#DFE19D width="121" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <b> Selecione</b> <th align="left" bgcolor=#DFE19D width="118" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <b><font size="2" face="arial"> Nome</font> </b> <td align="left" bgcolor=#DFE19D width="129" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <p align="center"><b><font size="2" face="arial"> Login</font></b></td> </tr> <%intCounter=0%> <%do until rs.EOF%> <% intCounter=intCounter+1 intMod=intcounter mod 2 if intmod=0 then rcolor = "#c0c0c0" elseif intmod=1 then rcolor = "#FFFFFF" end if %> <tr> <td align="left" bgcolor=<%=rcolor%> width="121" height="20"> <p align="right"> <font size="2" face="arial" color="BLACK"> <width=35%>Adiministrador<input type=CheckBox name=A value=<%=RS("nivel")%>><br> Moderador<input type=CheckBox name=M value=<%=RS("nivel")%>><br> Usurio<input type=CheckBox name=U value=<%=RS("nivel")%>><br> </font> <td align="left" bgcolor=<%=rcolor%> width="78" height="20"> <font size="2" face="arial" color="BLACK"> <%Response.Write (RS("nome"))%> </font> <td align="center" bgcolor=<%=rcolor%> width="127" height="20"> <font size="2" face="arial" color="BLACK"> <%Response.Write(RS("login"))%> </font> <%rs.MoveNext%> </font></tr> <% A = Request.Form("A") M = Request.Form("M") U = Request.Form("U") loop SET rs=nothing set conn=nothing %> <% If Request("A") = "on" Then strSQL = "UPDATE usuarios set nivel = '"&A&"'" conexao.Execute(strSQL) end if %> <% If Request("M") = "on" Then strSQL = "UPDATE usuarios set nivel = '"&M&"'" conexao.Execute(strSQL) end if %> <% If Request("U") = "on" Then strSQL = "UPDATE usuarios set nivel = '"&U&"'" conexao.Execute(strSQL) end if %> </table> <input type="submit" value="Atualizar Nivel" name="B1"> </form> </BODY> altera o nivel <%@ Language=VBScript%> <% intSno=Request("Delete") set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("dados.mdb")) id = Request("nivel") Set rs = conn.Execute("SELECT * FROM usuarios WHERE id = '"&id&"'") If rs.EOF Then Response.Write "O usurio no existe!!!" ElseIf rs("nivel") = "1" Then ' tire as aspas caso seja valor numrico no BD Response.Write "O man, no pode excluir usurios de nvel 1..." Else a=split(intSno,",") for iLoop=LBound(a) to UBound(a) intDelid=Trim(a(iLoop)) conn.Execute "update from usuarios where id = " & id & " " next Response.Write "O nivel do Usuario foi modificado" End If rs.Close Set rs = Nothing %>
-
pode fechar o tópico , já consegui achar o erro .
-
agora esta dando o erro . error '80020009' Exception occurred. /comunidade/validalogin.asp, line 14
-
o link do site é http://i.1asphost.com/comunidade/login.asp , digitem Login : 1 e Senha : 1 . O que esta errado , quando eu adicionei essa linha virou uma catastrofe , IF RS("banido") = true Response.Write ("Você esta Banido"). Me ajudem validalogin.asp <!--#include file="conectar.asp"--> <% login = Replace(request.form("login"), "'", "/") senha = Replace(request.form("senha"), "'", "/") Sql = "SELECT * FROM usuarios WHERE login = '"&login&"' AND senha='"&senha&"'" Set RS = Conexao.Execute(Sql) If not RS.EOF Then Response.Redirect "restrito.asp" Else IF RS("banido") = true Response.Write ("Você esta Banido") Else Session("login") = RS("login") Response.Redirect "login.asp" End IF END IF %>
-
http://i.1asphost.com/comunidade/deletar.asp , visitem o site , deleta algum usuario ai vai dar um erro , no meu micro não esta aparecendo o erro . Por que não esta deletando ......? o que esta acontecendo . Me expliquem deletar.asp <%@ Language=VBScript %> <%OPTION EXPLICIT%> <BODY> <FORM action="deleta.asp" method="Post" name=Form> <% Dim conn,rs,intCounter,intMod,rcolor,SQL set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("dados.mdb")) set rs = Server.CreateObject("ADODB.recordset") SQL = "select * from usuarios" RS.Open SQL,Conn,3,3 %> <table width="306" border="1" cellpadding="0" cellspacing="0" height="43" style="border-collapse: collapse" bordercolor="#CCCCCC"> <tr> <th align="left" bgcolor=#DFE19D width="84" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <b> Selecione</b> <th align="left" bgcolor=#DFE19D width="98" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <b><font size="2" face="arial"> Nome</font> </b> <td align="left" bgcolor=#DFE19D width="58" height="13" bordercolor="#FFFFFF" bordercolordark="#006699"> <p align="center"><b><font size="2" face="arial"> Login</font></b></td> </tr> <%intCounter=0%> <%do until rs.EOF%> <% intCounter=intCounter+1 intMod=intcounter mod 2 if intmod=0 then rcolor = "#c0c0c0" elseif intmod=1 then rcolor = "#FFFFFF" end if %> <tr> <td align="left" bgcolor=<%=rcolor%> width="84" height="20"> <font size="2" face="arial" color="BLACK"> <width=35%> <input type=CheckBox name=Delete value=<%=RS("id")%>> <td align="left" bgcolor=<%=rcolor%> width="58" height="20"> <font size="2" face="arial" color="BLACK"> <%Response.Write (RS("nome"))%> </font> <td align="center" bgcolor=<%=rcolor%> width="56" height="20"> <font size="2" face="arial" color="BLACK"> <%Response.Write(RS("login"))%> </font> <%rs.MoveNext%> </font></tr> <%loop SET rs=nothing set conn=nothing %> </table> <input type="submit" value="Deletar" name="B1"> </p> </form> </BODY> delete.asp <%@ Language=VBScript%> <% Option Explicit %> <% Dim intSno,intDelid,conn,a intSno=Request("Delete") set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open(Server.Mappath("dados.mdb")) login = Request.Form("login") SQL = "select * from usuarios where login = '"&login&"' " Set RS = conexao.Execute(SQL) a=split(intSno,",") dim iLoop for iLoop=LBound(a) to UBound(a) intDelid=Trim(a(iLoop)) conn.Execute "delete from usuarios where id=" & intDelid & "" next Response.Redirect "login.asp" conn.Close set conn=nothing %>