r7093: - added a new Form() ejs object for producing simple forms.
[samba.git] / swat / esptest / exception.esp
1 <% page_header("columns", "ESP Exception test"); %>
2
3 <h1>Samba4 exception test</h1>
4
5 <form name="ExceptionTest" method="POST" action="@@request['SCRIPT_NAME']"> 
6     <input name="submit" type="submit" value="Generate Exception">
7     <input name="submit" type="submit" value="No Exception">
8 </form>
9
10 <%
11 if (request['REQUEST_METHOD'] == "POST") {
12         function TestFunction(arg1, arg2) {
13                  return "OK";
14         }
15
16         if (form['submit'] == "Generate Exception") {
17             write("I expect you to die Mr Bond!<br>\n");
18             TestFunction("foo");
19         } else {
20             write("no exception<br>\n");
21             TestFunction("foo", "bar");
22         }
23 }
24 %>
25
26 and here is some filler text ...
27
28 <% page_footer(); %>