OK I "fixed" this.
For some reason, when I do:
yaws_api:queryvar(A, "username"),
erlyweb or yaws throws up about a badmatch. I thought that must have
been because the input was not in the yaws arg passed to the function
but a parse_post test I did showed that it was indeed in there. What I
did was to do a yaws_api:parse_post(A) and then use lists:keysearch to
pick up the relevant inputs.
Did I miss something here? How do people pick up POST parameters from
a request?
Nii Amon
On Oct 12, 9:53 am, nii amon <[EMAIL PROTECTED]> wrote:
> Hi guys
>
> I have a form like this:
>
> <form method="POST" action="/person/do_signup">
>
> <b>My username:</b>
> <input tabindex="1"
> type="text" name="username" id="username"
> class="off" onfocus="this.className='on'"
> onblur="this.className='off'" />
> </div>
> ......
> <input tabindex="7" type="submit">
>
> That form posts to this controller:
>
> -module(person_controller).
> -export([do_signup/1]).
>
> do_signup(A) ->
> case yaws_arg:method(A) of
> 'POST' ->
> ....
>
> For some strange reason, I keep getting this error when I submit the
> form against the controller function:
>
> ERROR erlang code crashed:
> File: appmod:0
> Reason: {{badmatch,undefined},
> [{person_controller,do_signup,1},
> {erlyweb,ewc,2},
> {erlyweb,handle_request,6},
> {yaws_server,deliver_dyn_part,8},
> {yaws_server,aloop,3},
> {yaws_server,acceptor0,2},
> {proc_lib,init_p,5}]}
> Req: {http_request,'POST',{abs_path,"/person/do_signup"},{1,1}}
>
> Since I have exported the function correctly and accepting the right
> number of parameters for the function, I am really stumped as to what
> is going in here. Anybody care to explain to me?
>
> Thanks
> Nii Amon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---