Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 67 lines (54 sloc) 1.959 kb
21abc5b Claes Wikstrom Initial revision
authored
1 <erl>
2
f448988 Claes Wikstrom ""
authored
3
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
4 box(Str) ->
5 {'div',[{class,"box"}],
f6dbbc9 Claes Wikstrom added possibility to name the module in a .yaws file
authored
6 {pre,[], yaws_api:htmlize(Str)}}.
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
7
8 fpostvar(A, Key) ->
ef3a52a Claes Wikstrom Removed the atoms in parse_post and parse query, backwards incompatible ...
authored
9 case postvar(A,"lang") of
0be3c7e Claes Wikstrom untabified all of yaws
authored
10 undefined -> "None";
11 {ok, Val} ->
12 Val
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
13 end.
14
15
16 out(A) ->
bea8261 Claes Wikstrom added log_wrap_size, configurable wrap size for all logs, fixed a bug in...
authored
17 [{ssi, "TAB.inc", [],[]},
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
18 {ehtml,
bea8261 Claes Wikstrom added log_wrap_size, configurable wrap size for all logs, fixed a bug in...
authored
19 {'div',[{id, "entry"}], [{h2, [],"post.yaws"},
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
20 {p,[],[ "This is the ", {tt, [], "post.yaws"}, " file ",
0be3c7e Claes Wikstrom untabified all of yaws
authored
21 "This yaws file gets invoked with POSTed client data. "
22 "This is the data that is submitted from the forms page ",
23 {a, [{href, "form.yaws"}], " form.yaws "}]},
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
24
25 {p, [], ["POST data is naturally organized as a ",
0be3c7e Claes Wikstrom untabified all of yaws
authored
26 {tt, [], "{Key, Value} "}, " list. A call to "
27 "the function ", {tt, [], "yaws_api:parse_post(A) "},
28 " will parse the POSTed data. and return a key/value list "]},
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
29 box("
30 out(A) ->
31 {ehtml,
32 {pre, [],
33 io_lib:format('~p', [yaws_api:parse_post(A)])}}.
34 "),
35
36 {p, [], "Produces the following output"},
37
38 box(io_lib:format('~p', [yaws_api:parse_post(A)])),
39 {p, [], ["The natural way to extract the \"Variables\" from "
40 " the posted data is to use the function (defined in yaws_api.erl) "
41 " called ", {tt,[], "postvar(Arg,Key) "}]},
42 {p, [], "Thus the following erlang code: "},
43 box("
44 out(A) ->
45 {ehtml,
46 {p,[], [\"The favourite programming language is \",
ef3a52a Claes Wikstrom Removed the atoms in parse_post and parse query, backwards incompatible ...
authored
47 case postvar(A,\"lang\") of
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
48 undefined -> \"None\";
49 {ok, Val} -> Val
50 end]}}.
51 "),
52
53 {p,[], "Produces the following output:"},
757eca1 Claes Wikstrom ""
authored
54 {hr,[],[]},
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
55 {'div',[{class,"box"}],
56 {p,[], ["The favourite programming language is ",
ffee7fc Claes Wikstrom some more debug support
authored
57 case postvar(A,"lang") of
58 undefined -> "None";
59 {ok, Val} -> Val
60 end]}}
bea8261 Claes Wikstrom added log_wrap_size, configurable wrap size for all logs, fixed a bug in...
authored
61 ]}},
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
62 {ssi, "END",[],[]}].
21abc5b Claes Wikstrom Initial revision
authored
63
f448988 Claes Wikstrom ""
authored
64
b2d5a00 Claes Wikstrom postvar(), queryvar(), ssi docs
authored
65 </erl>
21abc5b Claes Wikstrom Initial revision
authored
66
Something went wrong with that request. Please try again.