0
votes

I am building a login page for my website. Right now it is very simple, but it only seems to work in Firefox and I have no idea why. Here is where it seems to be breaking. The code sends the user's login information to login.php which will eventually check it with the database and then sends the user on to a welcome page. The user gets to the welcome page, but the information never seems to be sent to login.php when the user is using Chrome or IE.

    public function log():void
{
    u=user.text.toLowerCase();
    p=pass.text.toLowerCase();

    var urlVariables:URLVariables = new URLVariables;
    urlVariables.userName = u;
    urlVariables.password = p;

    var urlRequest:URLRequest = new URLRequest("mysite/login.php");
    urlRequest.data = urlVariables;


    sendToURL(urlRequest);

    navigateToURL(new URLRequest("mysite/welcome.html"), "_self");

}

Any ideas?

2

2 Answers

0
votes

Might be the fact you're navigating away IMMEDIATELY after sending the login request? IE might not be "fast enough" to send the request before aborting everything and going to the "welcome.html".

You might want to place the "navigateToURL" part in a listener to response to the login handler - but beware that it might be considered a security issue.

It'd be best if you navigated to the login handler with the data and had the "login.php" page redirect to "welcome.html". This will do the job done AND avoid any unpleasant surprises with the absurd Flash security model.

0
votes

Send http request operation will be crimp in as3 low-level code to execute. such as : URLLoader.load() method.

If you invoke this function twice at the same time,

URLLoader.load(new URLRequest(sitea));
URLLoader.load(new URLRequest(siteb));

some time will be lost too!

i think this is an AS3 low-level problem, or bug, or limit from security.