[Kepler-Project] how to use POST method in lua??

Andre Carregal carregal at fabricadigital.com.br
Sun Dec 23 08:29:01 GMT+3 2007


On 12/23/07, Javier Guerra <javier at guerrag.com> wrote:
> i guess you need a JavaScript hashing in your form's onSubmit() event.
> it could modify the data before sending to the server.

Exactly, and for that you could use the above mentioned Javascript library.

The instructions are here:
http://pajhome.org.uk/crypt/md5/instructions.html

And you can check an example in the source of the page:
http://pajhome.org.uk/crypt/md5/auth.html

The HTML form in that example is practically a standard one. In your
case you could use fill the challenge value in a LP template like:

<script src="md5.js" type="text/javascript"></script>
<form onsubmit="javascript:password.value=hex_hmac_md5(password.value,
challenge.value)">
<input type="hidden" name="challenge" value="<%= CHALLENGE %>">
<input type="text" name="username">
<input type="password" name="password">
<input type="submit" value="Login">
</form>

You can get md5.js here: http://pajhome.org.uk/crypt/md5/md5src.html

(I'm planning to add this hashing code to the check.lua/login.lp
CGILua examples too)

André



More information about the Kepler-Project mailing list