PDA

View Full Version : Loadvariables not working on Win2000 !?


Grandfather
06-15-2001, 07:35 PM
Hello ! I am happy I found this forum ! It might be my last chance to solve my problem (that drives me crazy!!).
I kept posting this question on other forums but seems like it's something that scares people ?! :D

So,here it goes :

-About:It's just a simple Flash login . Flash calls ASP scripts - data is kept in Access database.
-Problem:Everything works fine on Windows98 but on Windows2000 it doesn't ! (If the browser is IE ) . Strange:if the browser is Netscape it works on both Win98 and 2000 !!! (Netscape is great isn't it ? :D )

(I will provide almost all the code and I hope someone will be able to find my mistakes.. )

Ok,the "new user" and "existing user" code is almost the same for the asp .
Let's say an existing user comes back to the site and wants to login.

The flash code:
===============
//info=-1 at the beginning.

//The user puts the username/password and hits ok:
on (release, keyPress "<Enter>")
{
_root.loadVariables("old.asp","POST");
gotoAndStop ("check");
}

//at "check" keyframe in the main timeline I have a mc that tests the data arrived from asp:
onClipEvent(enterFrame)
{
if (_root.info==2)
{
_root.informer.gotoAndStop("oldok");
_root.display.gotoAndStop(2);
}

if(_root.info==3)
{
_root.informer.gotoAndStop("oldno");
_root.display.gotoAndStop(3);
}
// some more cases ...
}

Here's the asp code:
====================
<%@Language="VBScript"%>
<%
Option Explicit
Dim rs,conn,vusername,vpassword,vscore,sql_select,info
info=2

Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & "DBQ=" & Server.MapPath("db.mdb")

conn.Open

vusername=Request("username")
vpassword=Request("password")

sql_select=" SELECT * FROM users WHERE username='"&vusername&"' "

Set rs = Server.CreateObject("ADODB.Recordset")
Set rs = conn.execute(sql_select)

if rs.EOF=false then
if vpassword<>Trim(rs("password"))then
info=4
end if
else info=3
end if

if info=2 then 'success
vscore=rs("score")
Response.Write("&info=2"&"&score="&vscore)

else if info=4 then 'wrong password
Response.Write("&info=4")

else Response.Write("&info=3") 'no such user in the DB
end if
end if

rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>

I don't think I need URLEncode since I'm only sending numbers (1,2,3 or 4 ) back to flash and no special chars...

Details:
========
-everything works excellent if the browser is Netscape (on Win98 AND Win2000).
-everything works ok on Win98 + IE
-in Win2000 + IE , flash doesn't receive back any variables... I mean - info remains -1
-in win98 , in the cache I see the &info=2&score=0 string in a old.htm file ... strange , on Win2000 , it can be found in old.asp file !

Questions:
=========
Where am I wrong ??? :D

Thanks a lot !

philip
06-28-2001, 02:29 PM
Just a little question -- Shouldn't you use Request.Form when you're getting the variables in your asp script?

Grandfather
06-28-2001, 02:37 PM
Thanks,I'll try that .. anyway , since it _works_ on windows 98 this might not be the problem ..

Jesse
06-29-2001, 01:39 AM
well I dunno ASP but if I read your code right you are loading in the variable info and testing its value on later frames... correct?
if so remember that loaded values are strings so info will = "2" not 2... that would be effecting your conditionals.