r7088: start on some real structure for the SWAT web pages
[samba.git] / swat / esptest / formtest.esp
1 <% page_header("columns", "ESP Form Test"); %>
2
3 <form name="FormTest" method="POST" action="@@request['SCRIPT_NAME']"> 
4     firstName: <input name="firstName" type="text" value=""><br>
5     lastName:  <input name="lastName"  type="text" value=""><br>
6     <input name="submit" type="submit" value="OK">
7     <input name="submit" type="submit" value="Cancel"><br>
8 </form>
9
10 <%
11   /* if its a post then the user has filled in the form, so
12      report the values 
13   */
14   if (request['REQUEST_METHOD'] == "POST") {
15
16   /* if they cancelled then take them back to the list of tests */
17   if (form['submit'] == "Cancel") {
18      redirect("/");
19   }
20 %>
21   You chose firstName=@@form['firstName'] lastName=@@form['lastName']
22 <%
23
24    function showArray(name, array) {
25       write("<h3>Array: " + name + "</h3>\n");
26       for (v in array) {
27             write(name + "[" + v + "]=" + array[v] + "<br>\n");
28       }
29    }
30
31    showArray("form",    form);
32   }
33 %>
34
35 <% page_footer(); %>