1: <html>
2: <!-- $Id: demo.tmpl,v 1.1.1.1 2012/02/21 23:25:53 misho Exp $ -->
3: <head>
4: <title>PDEL HTTP server template demo</title>
5: </head>
6: <body bgcolor="#ffffff">
7:
8: <h3>PDEL Template Servlet</h3>
9:
10: @if(@query("shutdown"))
11: <b>Shutting down...</b>
12: @shutdown()
13: @return
14: @endif
15:
16: <p>
17: Welcome <b>@authname()</b>!
18:
19: <p>
20: This servlet is implemented via the http_servlet_tmpl(3) servlet
21: using the template file "demo.tmpl". To get to this servlet, you
22: must first satisfy the http_servlet_basicauth(3) servlet which requires
23: an HTTP "Basic" authentication using username "demo" and password
24: "demo".
25:
26: <p>
27: You can edit this file and reload from the browser and it should
28: update automatically.
29:
30: <p>
31: You are connecting from IP address <code>@remote_ip()</code>
32: and port <code>@remote_port()</code>.
33:
34: <p>
35: The current time now is @htmlencode(@date()).
36:
37: <p>
38: Now I'm going to sleep for one second... some browsers show
39: you the partial output, and some don't...
40:
41: <p>
42: @flush()
43: @sleep("1")
44:
45: <p>
46: The current time now is @htmlencode(@date()).
47:
48: <p>
49: Press <a href="/logon">HERE</a> to return to the logon page.
50:
51: <p>
52: <b>GET form</b>
53: <form method="get" action="/cgi/get?field4=foo&field5=bar">
54: <input type=hidden name="field1" value="value1">
55: <input type=hidden
56: name="field2" value="Foo Value with %percents% and & ampersand">
57: Enter some text:<input type=text name="field3">
58: <input type=submit value="Submit">
59: </form>
60:
61: <p>
62: <b>POST form</b>
63: <form method="post" action="/cgi/post?field4=foo&field5=bar">
64: <input type=hidden name="field1" value="value1">
65: <input type=hidden
66: name="field2" value="Foo Value with %percents% and & ampersand">
67: Enter some text:<input type=text name="field3">
68: <input type=submit value="Submit">
69: </form>
70:
71: <p>
72: Test of the http_servlet_file(3) servlet: click <a href="/file">HERE</a>
73: or <a href="/file/">HERE</a> to view the BIND documentation.
74:
75: <p>
76: To download a large file (/kernel): click <a href="/kernel">HERE</a>.
77:
78: @if(@not(@equal(@redirect(), "")))
79: <p>
80: To get redirected to <b>@htmlencode(@redirect())</b>:
81: click <a href="/redirect">HERE</a>.
82: @endif
83:
84: <p>
85: Test of file upload:
86:
87: <form method=post enctype="multipart/form-data" action="/cgi/post?file=1">
88:
89: Enter file name: <input type="file" size=40 name="file">
90:
91: <br>
92: <p>
93: <input type="submit" name="button1" value="Upload">
94:
95: </form>
96:
97: <p>
98: Press <a href="/tmpl?shutdown=1">HERE</a> to shutdown this web server.
99:
100: </body>
101: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>