Hi,
I'm trying to post a username and password to a server side script. The client provided an HTML form that demonstrates that the sever side functionality is working, but I keep getting the following:
<response>
Invalid UserName / Password Combination
</response>
Here's the HTML code:
html>
Here's what I have been doing in AS3:
var loader:URLLoader = new URLLoader();
configureListeners(loader);
var header:URLRequestHeader = new URLRequestHeader("pragma", "no-cache");
var request:URLRequest = new URLRequest("http://sitename.net/login");
request.data = new URLVariables();
request.data.username = "username";
request.data.password = "password";
request.method = URLRequestMethod.POST;
request.requestHeaders.push(header);
try {
loader.load(request);
} catch (error:Error) {
trace("Unable to load requested document.");
}
}
Any insight would be appreciated.
Best regards,
Chris McLaughlin
<html>
<head></head>
<body onLoad="document.input.submit()">
<form name="input" action="http://somesite.com/login" method="post">
<input type="text" name="username" value="username"/>
<input type="text" name="&password" value="password"/>
<form>
<body>
</html>
Sorry the HTML didn't display as expected.
Hi,
Well I have to say the apersand in the html code kept getting my attention and that is where the answer lies. It means that instead of passing 2 values as I was doing you have to pass 1 and you have to know how to URL encode the amersand which of ocurse I did not know.
So it's like this:
request.data= "username=someName&%26password=somePassword"
Geez!
North America
Europe, Middle East and Africa
Asia Pacific