PDA

View Full Version : got stuck with retriving data from asp.


darkstyle
07-26-2004, 02:22 PM
there we go again... well everything is responding correctly, when i click the login button... it verify the username and password from my access data base through login.asp file and it gives me response on my flash that its correct.

Response.Write "message=" & Server.URLEncode(oRS("username"))& "&var2=" & Server.URLEncode(oRS("password"))





now my probelm is :

if the password and username is right i want my flash file to go and play a specific frame.. how do i do it?? please help.



asp code is here..

<%@Language="VBScript"%>

<%



Dim oRS, oConn

set oRs=server.createobject("ADODB.recordset")

Set oConn = Server.CreateObject("ADODB.Connection")

oConn.open="dsn=DSNvazbo;persist security info=false;"



oRS.Open "SELECT * FROM logininfo", oConn, 2, 3

oRS.Find "username = '" & UCase(Request.QueryString("name"))& "'"

oRS.Find "password = '" & UCase(Request.QueryString("password")) & "'"

If oRS.EOF Then

Response.Write "message=Not+Found" & "&var2=Not+found"

Else

Response.Write "message=" & Server.URLEncode(oRS("username"))& "&var2=" & Server.URLEncode(oRS("password"))

End If

oRS.Close

Set oRS = Nothing

oConn.Close

Set oConn = Nothing

%>





i have attached the flash file. please help.

Cota
07-27-2004, 01:48 AM
If the username and password check out, why not just return a simple yes or no to flash. Then, in the sendandLoad onload function, you can have flash react to that message, if 'yes' then do this, if 'no' do this. Something like that.

darkstyle
07-27-2004, 07:48 AM
hmmmmmmm... i tried to follow your idea, i guess i am finding it little difficulty.. can you do it for me please... my file is already attached.

CyanBlue
07-27-2004, 02:55 PM
Easy $$$ to make, Cota... :D

Cota
07-28-2004, 01:47 AM
ok, I threw this together real quick and I didnt have time to test it. All the code is now in the button's on(release).

darkstyle
07-28-2004, 08:36 AM
your ASP code is working 100% fine ...

code here :
<%@Language="VBScript"%>

<%


Dim oRS, oConn
set oRs=server.createobject("ADODB.recordset")
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.open="dsn=DSNvazbo;persist security info=false;"


oRS.Open "SELECT * FROM logininfo", oConn, 2, 3
oRS.Find "username = '" & UCase(Request.QueryString("name"))& "'"
oRS.Find "password = '" & UCase(Request.QueryString("password")) & "'"

If oRS.EOF Then
Response.Write "&message=no"
Else
Response.Write "message=yes"
End If
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
%>


but i guess something wrong with the flash :(


i have used this code :
on (release) {
login = new loadVars();
login.username = _root.name.text;
login.thepassword = _root.thepassword.text;
login.onLoad = function(success) {
if (success) {
if (login.message == "yes") {
// You can go forward
gotoAndPlay(2);
} else {
// DENIED
gotoAndPlay(3);
}
}
};
login.sendAndLoad("login.asp", this, "POST");
}


it neither goes to the 2nd frame nor 3rd frame

darkstyle
07-28-2004, 08:38 AM
indeed its time to earn money as you guys are professional .:P

Cota
07-28-2004, 04:53 PM
Did you remove the old code from the keyframe? I left it in there, it could be causing a conflict.

darkstyle
07-28-2004, 09:43 PM
yup i did removed... and added two key frame ... 2nd key frame i wrote "done" and third i wrote "not done"... yet it doesnt proceed

i have attached the file with access data base

Files in the attachment are : login.fla,login.asp,dark.mdb