Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Me ajudem por favor. Eu peguei o script mas não consigo colocar pra funcionar. Vi um outro tópico falando pra mexer no arquivo config.asp, mas no script que peguei não tem. E se eu uso user e pass Admin, nada acontece.Alguém sabe me dizer o que fazer?
Esse é o problema! Não dá erro de sintaxe.o problema é que coloco user admin e senha admin, mas não acontece nada. Recarrega a mesma página. Já olhei o BD e está ok.Tem alguma coisa pra configurar?
Já exbiu o código fonte da págian html?Post o conteúdo do html aqui!t+
default.asp
<%=response.redirect ("chat/frame.asp")%>
login2.asp
<html><head><LINK REL="stylesheet" HREF="skin.css" TYPE="text/css"><title>Atendimento on-line</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="style.css" rel="stylesheet" type="text/css"></head><!-- Start the HTML body --><script LANGUAGE="JavaScript">function verificar_pedido() {var themessage = "Você não preencheu os campos: ";if (document.Login.login.value=="") {themessage = themessage + " - Login";}if (document.Login.Pass.value=="") {themessage = themessage + " - Senha";}//alertaif (themessage == "Você não preencheu os campos: ") {document.Login.submit();}else {alert(themessage);return false; }}// fim script verificar form de pedido musical --></script><body bgcolor="#FFFFFF" text="#000000" link="#176093" vlink="#176093" alink="#176093" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000"> <tr> <td class="main" align="center" bgcolor="#ffffff"> <div align="center"></div> <form name="Login" method="post" action="login_p2.asp"> <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#ffffff"> <tr align="center"> <td width="397" class="main"> </td> <td width="622" class="main"> </td> </tr> <tr align="center"> <td valign="top" colspan="2" class="main"><img src="images/topo_entrada.gif" width="250" height="80"> </td> </tr> <tr align="center"> <td colspan="2" class="main"> <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td height="20" align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">LOGIN:</font></td> </tr> <tr> <td align="center"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <input type="text" name="login" class="form"> </font></td> </tr> <tr> <td height="20" align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">SENHA:</font></td> </tr> <tr> <td align="center"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <input type="password" name="Pass" class="form"> </font></td> </tr> <tr> <td height="40" align="center"> <font size="1" face="Verdana, Arial, Helvetica, sans-serif"> <input type="submit" name="Submit" value="ENTRAR" class="form" onClick="verificar_pedido();"> </font></td> </tr> <tr> <td> </td> </tr> <tr> <td align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Powered by <a href="http://www.webcallsuporte.com.br" target="_blank">WEBcall Suporte</a></font></td> </tr> </table> </td> </tr> </table></form> </td> </tr></table><div align="center"><br></div><div align="center"></div></body></html>
login_p2.asp
<%Dim addpass addpass = Request.form("pass")login = request.form("login")session("login1") = request.form("login")Response.redirect("admin_menu2.asp?addpass="&addpass&"&login1="&login&"")%>
admin_menu2.asp
<!--#include file="common.asp" --><!--#include file="check_admin.asp" --><html><head><LINK REL="stylesheet" HREF="skin.css" TYPE="text/css"><title>aguarde...</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="refresh" content="1;URL=painel.asp?addpass=<%=addpass%>"></head><!-- Start the HTML body --><body bgcolor="#EDF0F7" text="#000000" link="#0000FF" vlink="#990099" alink="#FF0000"><Center> <div align="left"><br> <b><font color="#666666" size="1" face="Verdana, Arial, Helvetica, sans-serif"><b><br> aguarde ...<br> <br> </b></font></b><font color="#666666" size="1" face="Verdana, Arial, Helvetica, sans-serif">Acessando painel de administração !</font></div></body></html>
Acho que esses são os códigos necessários.
Deixa eu vêr se entendi a sequencia, o usuário entra na página login.asp e depois de dar o submit vai para a login_p2.asp, e onde está a parte que verifica no banco?
checkChat.asp
<%'Include this file on every page on your website, EXCEPT the livesupport pages'Checks to see if the user is wanted in a chat room by the admin and updates active users table'You will need to change DB path and name'Set the script timeout in secondsServer.ScriptTimeout = 90'Set Dimension VariablesDim strDataBasePath 'Holds the path to the databaseDim cString 'Holds the entire connection stringDim adoCon 'Holds the ado connectionDim SQL 'Holds SQL statementDim strIPAddress 'Holds the current users IP addressDim rs_Active_Users 'Record sheet for the active users tableDim chatwanted 'Holds 0 if admin doesnt to chat with them, 5 if the admin doesDim usrID 'Holds user IDSet adoCon = Server.CreateObject("ADODB.Connection")'------------------------------------------------------------------------------------'Change this value to the path of the databasestrDataBasePath = "chat/webdbat.mdb"'------------------------------------------------------------------------------------'Connection string for the database'If the following line does not work comment it out with a ' at the start of the line and uncomment another stringcString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(strDataBasePath)'Uncomment this connection string if you are using Access Database 2000 or 2002'cString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath(strDataBasePath) 'Uncomment this connection string if you are using a DSN (note: DSN is slower than the above connection strings)'cString = "DSN=NAME_OF_DSN"'Replace the NAME_OF_DSN with the DSN'Give the variables some valuesstrIPAddress = Request.ServerVariables("REMOTE_ADDR") 'Set the variable to hold the value of IP address'Open the connection to the database path specified at top of pageadoCon.Open cString'Open the active users record sheetSet rs_Active_Users = Server.CreateObject("ADODB.Recordset")'Create a new SQL statement to select the data from the row where users IP equals IP in databasestrSQL = "SELECT tblActiveUsers.* From tblActiveUsers WHERE IP='" & strIPAddress & "';"'Set the cursor and lock typesrs_Active_Users.CursorType = 2rs_Active_Users.LockType = 3'Open the record sheets and execute the SQL statementrs_Active_Users.Open strSQL, CString'Check the database to see if the user whos online has a field in the database, if not create oneIf rs_Active_Users.EOF Then 'Insert the users IP address into a new row in databasestrSQL = "INSERT INTO tblActiveUsers (IP) VALUES ('" & strIPAddress & "');"'Write dataadoCon.Execute(strSQL) 'If there is a record for the current user then update, dont create newElse'Set new SQL statement, set the last active field to the current timestrSQL = "UPDATE tblActiveUsers SET tblActiveUsers.LastActive=Now() WHERE IP='" & strIPAddress & "';"'Write dataadoCon.Execute(strSQL) End If'Delete records older than 10 minuites, they are no longer activestrSQL = "DELETE FROM tblActiveUsers WHERE tblActiveUsers.LastActive < Now() - 0.0070;"'Write dataadoCon.Execute(strSQL)'Requery the record sheet to get data up to daters_Active_Users.Requery'Close n' clean!rs_Active_Users.CloseSet rs_Active_Users = NothingadoCon.close'Open the table tblActiveUsersset rs_Active_Users = server.createobject("ADODB.RecordSet")'Create new SQL stringStrSql="SELECT * FROM tblActiveUsers WHERE IP='" & strIPAddress & "';"'Open record sheet execute SQL stringrs_Active_Users.open StrSql,cString,3,3'Take the values from the database field and put them in the variableschatwanted = rs_Active_Users("ChatRequest")usrID = rs_Active_Users("ID")'Close the record sheet and clean uprs_Active_Users.CloseSet rs_Active_Users = Nothing%><%'If the field chatwanted is set to something other than 0 Then open chat automaticalyIF chatwanted <> 0 THEN%><script language="Javascript">pop1=window.open("chat/default.asp?q=1","pop1","width=400, height=300, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no");</script><%ELSE%><%END IF%>Consegui fazer esse login. mas não estou entendendo o funcionamento.por onde entra pra ser atendido?quando abre a página default, pede login e senha pra ir pra área administrativa... e o principal que é o atendimento eu não sei.Alguém saberia me explicar?Já viram esse script rodando em algum site?
chat/default.asp
Dim strQ,login_o
strQ = Request.querystring("Q")
IF strQ = "1" THEN strQ = strTxtAdminRequest ELSE strQ = "" END IF
%>
<%
'Set some variables
Dim rsChatRequest2 'Chat request record sheet
'Open a new connection to the database
adoCon.Open cString
'Create new SQL string
StrSQL="SELECT * FROM tblActiveUsers WHERE IP='" & strIPAddress & "';"
'StrSQL="SELECT * FROM tblActiveUsers;"
'Create new record sheet
set rsChatRequest2 =Server.CreateObject("ADODB.Recordset")
'Set cursor and locktypes
rsChatRequest2.CursorType = 2
rsChatRequest2.LockType = 3
'Open row data where the logged in users IP equals the IP in the database
rsChatRequest2.open StrSQL, CString
'Set
rsChatRequest2.fields("ChatRequest")=0
rsChatRequest2.Update
'Close record sheet and clean up
rsChatRequest2.Close
Set rsChatRequest2 = Nothing
'set rs1 = server.createobject("ADODB.RecordSet")
'StrSq1="SELECT * FROM tblSettings"
'rs1.open StrSq1,cString,3,3
'if rs1.recordcount <= CInt("3") then
'NomeOperador = rsp("OperatorName")
'login_o = rsp("login")
'end if
'if rs1.recordcount => CInt("1") then
'set rs0 = server.createobject("ADODB.RecordSet")
'StrSq0_0="SELECT TOP 1 * FROM tblSettings where o_ocupado <> 1 AND o_online = 1 order by id desc "
'rs0.open StrSq0_0,cString
'if rs0.EOF then
'response.redirect "una.asp"
'end if
'NomeOperador = rs0("OperatorName")
'login_o = rs0("login")
'end if
%>
<%
'Redirect the administrator if the password in query string matches the one in the database
IF strAdminPass = QstrAdminPass THEN Response.redirect("chat.asp?addpass="&strAdminPass&"&ID="&intUsrID)
%>
<html>
<head>
<title><%=strTxttitulosite%></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
<script language="javascript">
function centraliza(x,y)
{
window.resizeTo(x,y);
window.moveTo((window.screen.width-x)/2,(window.screen.height-y)/2);
}
centraliza(410,350);
</script>
<script language="javascript">
function centraliza(x,y)
{
window.resizeTo(x,y);
window.moveTo((window.screen.width-x)/2,(window.screen.height-y)/2);
}
centraliza(410,350);
</script>
<style type="text/css">
<!--
.style1 {
font-family _linenums:0'><!--#include file="common.asp" --><!--#include file="check.asp" --><%'On Error Resume NextDim strQ,login_ostrQ = Request.querystring("Q")IF strQ = "1" THEN strQ = strTxtAdminRequest ELSE strQ = "" END IF%><%'Set some variablesDim rsChatRequest2 'Chat request record sheet'Open a new connection to the databaseadoCon.Open cString'Create new SQL stringStrSQL="SELECT * FROM tblActiveUsers WHERE IP='" & strIPAddress & "';"'StrSQL="SELECT * FROM tblActiveUsers;"'Create new record sheetset rsChatRequest2 =Server.CreateObject("ADODB.Recordset")'Set cursor and locktypesrsChatRequest2.CursorType = 2rsChatRequest2.LockType = 3'Open row data where the logged in users IP equals the IP in the databasersChatRequest2.open StrSQL, CString'SetrsChatRequest2.fields("ChatRequest")=0rsChatRequest2.Update'Close record sheet and clean uprsChatRequest2.CloseSet rsChatRequest2 = Nothing'set rs1 = server.createobject("ADODB.RecordSet")'StrSq1="SELECT * FROM tblSettings"'rs1.open StrSq1,cString,3,3'if rs1.recordcount <= CInt("3") then'NomeOperador = rsp("OperatorName")'login_o = rsp("login")'end if'if rs1.recordcount => CInt("1") then'set rs0 = server.createobject("ADODB.RecordSet")'StrSq0_0="SELECT TOP 1 * FROM tblSettings where o_ocupado <> 1 AND o_online = 1 order by id desc "'rs0.open StrSq0_0,cString'if rs0.EOF then'response.redirect "una.asp"'end if'NomeOperador = rs0("OperatorName")'login_o = rs0("login")'end if%><% 'Redirect the administrator if the password in query string matches the one in the database IF strAdminPass = QstrAdminPass THEN Response.redirect("chat.asp?addpass="&strAdminPass&"&ID="&intUsrID)%><html><head><title><%=strTxttitulosite%></title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="style.css" rel="stylesheet" type="text/css"><script language="javascript">function centraliza(x,y){ window.resizeTo(x,y); window.moveTo((window.screen.width-x)/2,(window.screen.height-y)/2);}centraliza(410,350);</script><script language="javascript">function centraliza(x,y){ window.resizeTo(x,y); window.moveTo((window.screen.width-x)/2,(window.screen.height-y)/2);}centraliza(410,350);</script><style type="text/css"><!--.style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px;}.formulario { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000}--> </style><script>function carregar(){var url;url = '<%=strTxtDominio%>/chat/remote1.asp?aux=1&depto='+document.form1.Departamento[document.form1.Departamento.selectedIndex].value;document.form1.login_o.options.length = 0;if (document.form1.Departamento.value=="semdepto"){window.location.href='default.asp';}else{addItem(document.form1.login_o,"Aguarde...carregando", "",false,document.form1.login_o.length)}myIframe.location = url;//document.form1.login_o.focus()}function inicia(){local1 = new Array();var maximo1, i, campo1;local1 = myIframe.org;campo1 = document.form1.login_o;maximo1 = local1.length;document.form1.login_o.options.length = 0;//addItem(campo1,'TODAS','',false,campo1.length);for (i=0;i<maximo1;i++){ addItem(campo1,local1*[1],local1**[0],false,campo1.length);}}function addItem(obj,strText,strValue,blSel,intPos){ var newOpt,i,ArTemp,selIndex; selIndex = (blSel)?intPos:obj.selectedIndex; newOpt = new Option(strText,strValue); Len = obj.options.length+1 if (intPos > Len) return obj.options.length = Len if (intPos != Len) { ArTemp = new Array(); for(i=intPos;i<obj.options.length-1;i++) ArTemp** = Array(obj.options**.text,obj.options**.value); for(i=intPos+1;i<Len;i++) obj.options** = new Option(ArTemp[i-1][0],ArTemp[i-1][1]); } obj.options[intPos] = newOpt; if (selIndex > intPos) obj.selectedIndex = selIndex+1; else if (selIndex == intPos) obj.selectedIndex = intPos; } function validar(){ if ((document.form1.login.value=="")||(document.form1.Departamento.value=="semdepto")||(document.form1.login_o.value=="0")){ alert("Preencha todos os campos!"); return;}}</script></head><body bgcolor="#FFFFFF" text="#000000" link="#176093" vlink="#176093" alink="#176093" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="java script:document.all.operadores.style.visibility = 'hidden'" ><div style="DISPLAY: none; POSITION: absolute" align="left"><IFRAME src=<%=strTxtDominio%>/chat/remote1.asp name="myIframe" id="myIframe" width="100" height="100" marginwidth="0" marginheight="0"></IFRAME></div><br><table width="400" height="240" border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" align="center"><img src="images/topo.gif"> <form action="chat_sort.asp" method="post" name="form1" id="form1" onSubmit=java script:validar();> <div align="center"> <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td align="center"> </td> </tr> <tr> <td align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> <%=strTxtWelcome%> </font></td> </tr> <tr> <td align="center"> </td> </tr> <tr> <td align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Seu nome:</font> <input type="text" name="login" size="15" class="form"> </td> </tr> <tr> <td align="center"><img src="#" width="8" height="5"></td> </tr> <tr> <td align="center"><select name="Departamento" onChange="java script:carregar();document.all.operadores.style.visibility = 'visible' " class="form"> <option value="semdepto" selected>Escolha o departamento:</option> <%set rsq = server.createobject("ADODB.RecordSet")StrSqq="SELECT distinct Departamento FROM tblSettings where o_online = 1 order by departamento asc "rsq.open StrSqq,cStringif rsq.EOF thenresponse.redirect "una.asp"end ifWhile NOT rsq.EOFdepartamento = rsq("Departamento")%> <option value="<%=departamento%>"><%=departamento%></option> <%rsq.movenextwend%> </select> </td> </tr> <tr> <td align="center"><img src="#" width="8" height="5"></td> </tr> <tr> <td align="center" id="operadores"><select name="login_o" size="1" class="form"> </select> </td> </tr> <tr> <td align="center"><img src="#" width="8" height="5"></td> </tr> <tr> <td align="center"><input name="Submit" type="submit" class="form" value="entrar"></td> </tr> <tr> <td align="center"> </td> </tr> </table> </div> </form></td> </tr></table></body></html>*
*
pq redireciona para email.asp? preciso desativar esse redirecionamento.*
Queirda _Juliana_No exemplo postado não vi o redireciona para email.asp!Será que esta no include?Posta o código htnl (no browser escolha exibir código fonte) e post aqui para fermos as chamadas e funções inclusive dos includes.Mas se esta redirecionando é só localiza onde isto esta sendo feito e retirar.t+
Galera... alguem pode ajudar... fiz todas as mudanças possiveis para fazer funcionar o Webcall, mas parece q eh impossivel configura-lo... normalmente ele funciona dentro de mesma pasta onde está os outros arquivos do webcall, só que esbarra no problema de restrição de escrita... aparentemente ele lê mas naum consegue gravar dados... já tentei direcionar todos os caminhos para o servidor de BD mas qdo se faz issu ele somente fica carregando a pagina de login sem logar...parece que há alguma coisa relacionada com um arquivo chamado validate.asp, se alguem souber aguma coisa sobre isto só falta issu pra funcionar bem... se alguem já conseguiu fazer com que ele esteja direcionado para a pasta de BD do servidor poderiamos compartilhar nossas ideias...Um abraço a todos...Joshua
já colocou o arquivo global.asa na raiz do site?
Galera já consegui fazer funcionar perfeitamente...
Todos os problemas estão relacionados ao caminho do banco de dados que estão dividos em varios arquivos... vou cita-los abaixo e eh somente direcionar para o local correto...
dentro da Pasta chat:
Default.asp(<%=strTxtDominio%>/webcall/chat/remote1.asp)
common.asp
remote1.asp
msg_status.asp
log.asp
functions.asp
checkchat.asp
dentro da pasta Webcall:
Checkchat.asp
Todo sistema foi desenvolvido para rodar dentro da raiz do site... o problema todo eh pq está dentro da pasta Webcall pelo que pude ver...
Sem alguem tiver duvida... eh só postar
Joshua
>
Esse é o problema! Não dá erro de sintaxe.
o problema é que coloco user admin e senha admin, mas não acontece nada. Recarrega a mesma página. Já olhei o BD e está ok.
Tem alguma coisa pra configurar?
resposta acima.... pra fazer funcionar!!!
joshua
Posta o erro e o script ai.Fica mais fácil ajudá-la.t+