Comunidad de diseño web y desarrollo en internet online

PASAR LOGIN DE ASP A FLASH

Citar            
MensajeEscrito el 26 Jul 2006 08:43 am
Buenos dia.

Mirad tengo el siguiente problema o duda, llamarlo como querais.

Estoy pasando mi Web de formato html,asp a flash
y estoy un poco perdido en el apartado de login "del flash"

El Asp lo tengo funcionado con el formulario "usuario, password" que tiene el mismo, lo unico seria que pudiera acceder desde el formulario de flash

Actualmente este es el codigo que tengo en la pagina asp para hacer el login

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="grup90.css" rel="stylesheet" type="text/css">
<style type="text/css">

<!--

body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #D5EAFD;
}

.Estilo2 {color: #FFFFFF}
.Estilo6 {font-family: Verdana, Arial, Helvetica, sans-serif}

-->

</style>
</head>

<body><%
usuario=Request.Form("usuario")
password=Request.Form("password")

if password="" then password="kilimanjaro"
Set Conn = Server.CreateObject("ADODB.Connection")
DSNtest="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtest=dsntest & "DBQ=" & Server.MapPath("/Data/usuarios.mdb")
Conn.Open DSNtest

sql="SELECT * FROM usuarios WHERE usuario='"&usuario&"'"
set objRS=Conn.Execute(sql)

tipoagente="inicio"
if not ( objRS.BOF=true) and not(objRS.EOF=true) then
if( password =objRS("password")) then

if(objRS("seccion")="n") then

tipoagente="../preusnac/index.asp"
end if

if(objRS("seccion")="i") then

tipoagente="../preusint/index.asp"

end if

response.write "<form name=""salto"" method=""post"" action="""&tipoagente& """>"
response.write "<input type=""hidden"" name=""jvbtrds"" value=""klxxcvbc"">"
response.write "<input type=""hidden"" name=""ACCION"" value=""entrar"">"
response.write "</form>"
response.write"<script language=""javascript"">document.salto.submit();</script>"

end if
end if

%>





<%if tipoagente="inicio" then%>

<table width="772" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#D5EAFD">

<tr>

<td width="20" rowspan="3"><table width="20" height="100%" border="0" cellpadding="0" cellspacing="0" background="motiuesq.gif">
<tr>
<td>&nbsp;</td>
</tr>
</table></td>
<td width="732" height="77" valign="top" bgcolor="#FFFFFF"><table width="733" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

<tr>
<td width="732"><img src="caps.jpg" width="732" height="58"></td>
</tr>

<tr>
<td></td>
</tr>
</table></td>

<td width="20" rowspan="3" background="img_web/motiudret.gif">&nbsp;</td>
</tr>
<tr>
<td width="732" height="100%" align="left" valign="top" bgcolor="#FFFFFF"><div align="center">
<p>&nbsp;</p>
</div>

<form name="validar" action="index.asp" method="post">
<div align="center"> <span class="Estilo2">.......</span><span class="Estilo6">AGENTE</span> <input name="usuario" type="text" >
<br>

<p>
<span class="Estilo6">PASSWORD</span>
<input type="password" name="password">

<br>
</p>
<p><span class="Estilo2">............</span>

<input type="button" name="enviar" value="Aceptar" onClick="document.validar.accion.value='consultar';document.validar.submit()">

<input type="hidden" name="accion">
</p>
</div>

</form>
<div align="center"><img src="Areaprivada.jpg" width="732" height="334"></div></td>
</tr>
<tr>
<td width="732" height="100%" valign="bottom" bgcolor="#FFFFFF"><div align="center"><img src="base.gif" width="732" height="18" border="0" align="absmiddle" usemap="#Map">
</div></td>
</tr>
</table>
<%end if%>

</body>
</html>
<%

objRS.Close
Set objRS = Nothing
Conn.Close
Set Conn= Nothing
%>


Y el codigo del flash con el que estoy haciendo pruebas pero no acabo de hacerlo funcionar es este.

(esto esta situado en el primer frame)

stop ();
var envio:LoadVars = new LoadVars();
var recibir:LoadVars = new LoadVars();
function login() {
envio.usuario = usuario_txt.text;
envio.password = password_txt.text;
envio.action = "login";
envio.sendAndLoad("http://www.grup90.net/httpdocs/agentes/index2.asp", recibir, "POST");
}
recibir.onLoad = function(exito) {
if (exito) {
switch (this.opcion) {
case "0" :
mensaje_txt.text = "no existe el usuario";
break;
case "1" :
mensaje_txt.text = "nombre de usuario o pass mal ingresado";
break;
case "2" :
mensaje_txt.text = "datos correctos";
//acá pueden agregar acciones para los registrados
break;
default :
mensaje_txt.text = "no hay conexión";
break;
}
} else {
mensaje_txt.text = "Error en el Script";
}
};


Haber si me podeis hechar una mano, ha enlazar el flash con el asp.
Gracias

Por Enigma_ct

25 de clabLevel



 

msie
Citar            
MensajeEscrito el 26 Jul 2006 08:47 am
Perdonad, he escrito mal el codigo del flash

Y el codigo del flash con el que estoy haciendo pruebas pero no acabo de hacerlo funcionar es este.

(esto esta situado en el primer frame)

stop ();
var envio:LoadVars = new LoadVars();
var recibir:LoadVars = new LoadVars();
function login() {
envio.usuario = usuario_txt.text;
envio.password = password_txt.text;
envio.action = "login";
envio.sendAndLoad("/agentes/index2.asp", recibir, "POST");
}
recibir.onLoad = function(exito) {
if (exito) {
switch (this.opcion) {
case "0" :
mensaje_txt.text = "no existe el usuario";
break;
case "1" :
mensaje_txt.text = "nombre de usuario o pass mal ingresado";
break;
case "2" :
mensaje_txt.text = "datos correctos";
//acá pueden agregar acciones para los registrados
break;
default :
mensaje_txt.text = "no hay conexión";
break;
}
} else {
mensaje_txt.text = "Error en el Script";
}
};

Por Enigma_ct

25 de clabLevel



 

msie
Citar            
MensajeEscrito el 27 Jul 2006 04:54 pm
NAdie me puede ayudar?

Por Enigma_ct

25 de clabLevel



 

msie
Citar            
MensajeEscrito el 27 Jul 2006 09:23 pm
Salu2 Enigma_ct

Por favor coloca los codigos en las etiquetas Code... y por favor no presiones ya que todos los clabbers no tenemos el tiempo 100% para resolver inquietudes de los foros... Espera con paciencia que alguno te pueda ayudar....

Salu2...

Por Blackdragon

Claber

3776 de clabLevel

24 tutoriales

Genero:Masculino   Premio_Secretos Héroes

In one of the pits of hell, fighting for my soul

firefox
Citar            
MensajeEscrito el 28 Jul 2006 08:04 am
Gracias por contestar, y no es que presione, o no pretendia,. Ahora pondre los codigos en code, gracias por la sugerencia.

Codigo del asp:

Código :

<html> 
<head> 
<title></title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
<link href="grup90.css" rel="stylesheet" type="text/css"> 
<style type="text/css"> 

<!-- 

body { 
margin-left: 0px; 
margin-top: 0px; 
margin-right: 0px; 
margin-bottom: 0px; 
background-color: #D5EAFD; 
} 

.Estilo2 {color: #FFFFFF} 
.Estilo6 {font-family: Verdana, Arial, Helvetica, sans-serif} 

--> 

</style> 
</head> 

<body><% 
usuario=Request.Form("usuario") 
password=Request.Form("password") 

if password="" then password="kilimanjaro" 
Set Conn = Server.CreateObject("ADODB.Connection") 
DSNtest="DRIVER={Microsoft Access Driver (*.mdb)}; " 
DSNtest=dsntest & "DBQ=" & Server.MapPath("/Data/usuarios.mdb") 
Conn.Open DSNtest 

sql="SELECT * FROM usuarios WHERE usuario='"&usuario&"'" 
set objRS=Conn.Execute(sql) 

tipoagente="inicio" 
if not ( objRS.BOF=true) and not(objRS.EOF=true) then 
if( password =objRS("password")) then 

if(objRS("seccion")="n") then 

tipoagente="../preusnac/index.asp" 
end if 

if(objRS("seccion")="i") then 

tipoagente="../preusint/index.asp" 

end if 

response.write "<form name=""salto"" method=""post"" action="""&tipoagente& """>" 
response.write "<input type=""hidden"" name=""jvbtrds"" value=""klxxcvbc"">" 
response.write "<input type=""hidden"" name=""ACCION"" value=""entrar"">" 
response.write "</form>" 
response.write"<script language=""javascript"">document.salto.submit();</script>" 

end if 
end if 

%> 





<%if tipoagente="inicio" then%> 

<table width="772" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#D5EAFD"> 

<tr> 

<td width="20" rowspan="3"><table width="20" height="100%" border="0" cellpadding="0" cellspacing="0" background="motiuesq.gif"> 
<tr> 
<td>&nbsp;</td> 
</tr> 
</table></td> 
<td width="732" height="77" valign="top" bgcolor="#FFFFFF"><table width="733" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> 

<tr> 
<td width="732"><img src="caps.jpg" width="732" height="58"></td> 
</tr> 

<tr> 
<td></td> 
</tr> 
</table></td> 

<td width="20" rowspan="3" background="img_web/motiudret.gif">&nbsp;</td> 
</tr> 
<tr> 
<td width="732" height="100%" align="left" valign="top" bgcolor="#FFFFFF"><div align="center"> 
<p>&nbsp;</p> 
</div> 

<form name="validar" action="index.asp" method="post"> 
<div align="center"> <span class="Estilo2">.......</span><span class="Estilo6">AGENTE</span> <input name="usuario" type="text" > 
<br> 

<p> 
<span class="Estilo6">PASSWORD</span> 
<input type="password" name="password"> 

<br> 
</p> 
<p><span class="Estilo2">............</span> 

<input type="button" name="enviar" value="Aceptar" onClick="document.validar.accion.value='consultar';document.validar.submit()"> 

<input type="hidden" name="accion"> 
</p> 
</div> 

</form> 
<div align="center"><img src="Areaprivada.jpg" width="732" height="334"></div></td> 
</tr> 
<tr> 
<td width="732" height="100%" valign="bottom" bgcolor="#FFFFFF"><div align="center"><img src="base.gif" width="732" height="18" border="0" align="absmiddle" usemap="#Map"> 
</div></td> 
</tr> 
</table> 
<%end if%> 

</body> 
</html> 
<% 

objRS.Close 
Set objRS = Nothing 
Conn.Close 
Set Conn= Nothing 
%> 


Y este es el codigo del Flash situado en el primer frame:


Código :

stop (); 
var envio:LoadVars = new LoadVars(); 
var recibir:LoadVars = new LoadVars(); 
function login() { 
envio.usuario = usuario_txt.text; 
envio.password = password_txt.text; 
envio.action = "login"; 
envio.sendAndLoad("/agentes/index2.asp", recibir, "POST"); 
} 
recibir.onLoad = function(exito) { 
if (exito) { 
switch (this.opcion) { 
case "0" : 
mensaje_txt.text = "no existe el usuario"; 
break; 
case "1" : 
mensaje_txt.text = "nombre de usuario o pass mal ingresado"; 
break; 
case "2" : 
mensaje_txt.text = "datos correctos"; 
//acá pueden agregar acciones para los registrados 
break; 
default : 
mensaje_txt.text = "no hay conexión"; 
break; 
} 
} else { 
mensaje_txt.text = "Error en el Script"; 
} 
};



Gracias por vuestra ayuda, un cordial saludo a todos :cool:

Por Enigma_ct

25 de clabLevel



 

msie
Citar            
MensajeEscrito el 31 Jul 2006 09:50 am
Vuelvo a repetir, no es por exigir, pero me gustaria saber si hay alguien que me podria ayudar?

Por Enigma_ct

25 de clabLevel



 

msie
Citar            
MensajeEscrito el 04 Ago 2006 09:14 am
asi todavia nadie me ha podido contestar a mi duda.

Si lo unico que pido que modificacion debo hacer, a uno de vuestros tutoriales.

Para relacionar el formulario que tengo en un html, para acceder a una zona privada, relacionandolo con la base de datos, claro; con los campos del flash.

O sea, en vez de el html, en el flash.

Perdonad mi insitencia, pero no consigo encontrar la solucion.

Una saludo

Por Enigma_ct

25 de clabLevel



 

msie

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.