Mercurial > urweb
view tests/cookieJsec.ur @ 2053:229a299d739d
Add tests/dbupload2.* files
tests/dbupload2.sh is a shell script which run the test scenario
On my machine the executable segfaults after curl request
author | Sergey Mironov <grrwlf@gmail.com> |
---|---|
date | Fri, 15 Aug 2014 07:11:31 +0000 |
parents | 796e42c93c48 |
children |
line wrap: on
line source
table t : {Id : int} cookie c : int fun setter r = setCookie c (readError r.Id); return <xml>Done</xml> fun writer () = ido <- getCookie c; case ido of None => error <xml>No cookie</xml> | Some id => dml (INSERT INTO t (Id) VALUES ({[id]})) fun preWriter () = return <xml><body onload={onConnectFail (alert "RPC error")}> <button onclick={writer ()} value="Write to database"/> <a link={main ()}>Back</a> </body></xml> and main () = return <xml><body> <form> <textbox{#Id}/> <submit value="Get cookie" action={setter}/> </form> <form><submit action={preWriter} value="Prepare to write to database"/></form> </body></xml>