Hi all,
I try to make a simple login. I use the code
function sendVars_login(event:MouseEvent):void
{
var scriptRequest_login:URLRequest = new URLRequest("http://******.aspx");
var scriptLoader_login:URLLoader = new URLLoader();
var scriptVars_login:URLVariables = new URLVariables();
scriptLoader_login.addEventListener(Event.COMPLETE, handleLoadSuccessful_login);
scriptLoader_login.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError_login);
scriptLoader_login.dataFormat = URLLoaderDataFormat.TEXT;
var email:String = email_txt.text;
var pass:String = pass_txt.text;
scriptVars_login.u_pass = pass
scriptVars_login.u_email =email
scriptRequest_login.method = URLRequestMethod.POST;
scriptRequest_login.data = scriptVars_login;
scriptLoader_login.load(scriptRequest_login);
}
when i send the vars i get back that user doesn’t exists although i have checked that it exists.
A funny thing is that when i change the following
scriptVars_login.u_pass = "somePass"
scriptVars_login.u_email ="someEmail"
I get correct results. So the .aspx script works and the way i’m sending the variable works.
when i trace
scriptRequest_login.data
i get a url encoded string, so i tried to unescape the value
var unescapedString = unescape(String(scriptVars_login));
scriptRequest_login.data = unescapedString;
scriptLoader_login.load(scriptRequest_login);
now when i trace(scriptRequest_login.data) i get an unescaped value but it still doesn’t work
Any suggestions would be very helpfull.
Thanx in advance