java server xml

Why isnt my value getting updated? – PHP?
Hi,
I have an java applet communicaing with an php server using xml-rpc. I created a login system that records the amount of failed login attempts, but my variable that gets sent bak to the client isnt updating right.
function Login($xmlrpcmsg)
{
$USERNAME = $xmlrpcmsg->getParam(0)->scalarVal();
$PASSWORD = $xmlrpcmsg->getParam(1)->scalarVal();
$FAILED_ATTEMPTS;
$result = “Returned Data:” . “Username: ” . $USERNAME . ” Password: ” . $PASSWORD;
if($USERNAME == “Admin”)
{
if($PASSWORD == “root”)
{
return new xmlrpcresp(new xmlrpcval(“Welcome administrator!”,”string”));
}
$FAILED_ATTEMPTS = $FAILED_ATTEMPTS + 1;
return new xmlrpcresp(new xmlrpcval(“Invalid Authorization! $FAILED_ATTEMPTS”));
}
return new xmlrpcresp(new xmlrpcval($result, “string”));
}
What am i doing wrong? When i enter in bad values for the pwd of Admin it only shows Failed Attempts 1! Its not incrementing…
Thank you!
$FAILED_ATTEMPTS is a local variable, which is only for one call of Login() function guilty.
String “$FAILED_ATTEMPTS;” does not have sence.
You should use $_SESSION[''failed_attempts"] instead of $FAILED_ATTEMPTS.
I think that was the problem.
|
|
JavaScript: The Definitive Guide $26.00 Since the earliest days of Internet scripting, Web developers have considered JavaScript: The Definitive Guide an essential resource. David Flanagan’s approach, which combines tutorials and examples with easy-to-use syntax guides and object references, suits the typical programmer’s requirements nicely. The brand-new fourth edition of Flanagan’s “Rhino Book” includes coverage of JavaScript 1.5, JS… |
|
|
Enterprise Development with Flex: Best Practices for RIA Developers (Adobe Dev Lib) $29.99 If you want to use Adobe Flex to build production-quality Rich Internet Applications for the enterprise, this groundbreaking book shows you exactly what’s required. You’ll learn efficient techniques and best practices, and compare several frameworks and tools available for RIA development — well beyond anything you’ll find in Flex tutorials and product documentation. Through many practical exampl… |
|
|
Enterprise Service Bus: Theory in Practice $13.88 Large IT organizations increasingly face the challenge of integrating various web services, applications, and other technologies into a single network. The solution to finding a meaningful large-scale architecture that is capable of spanning a global enterprise appears to have been met in ESB, or Enterprise Service Bus. Rather than conform to the hub-and-spoke architecture of traditional… |
|
|
Java And Xml $43.49 Java And Xml |