cgi /libs/cgi/doc/src/utilities/sessions/sessions_quickstart.html

Language HTML Lines 83
MD5 Hash 7b77e04657ba93d8f630cdf0e4eadff5
Repository git://github.com/darrengarvey/cgi.git View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>Basic Login Example</title>
    <style type="text/css">
        body {
            width: 100%;
            padding: 0;
            margin: 0;
        }
        #body {
            padding: 10px;
            width: 400px;
        }
{{#LOGIN_FORM}}
        #login-form {
            background: #C8F0B7;
            border:2px solid #98D087;
            padding:10px;
        }
        #login-form label {
            float: left;
            text-align: right;
            padding: 0px 10px;
            width: 150px;
            display: block;
        }
        #login-form input {
            margin: 0 10px;
        }
{{/LOGIN_FORM}}
{{#HAS_ERROR}}
        div.error {
            border: 2px solid #dd4444;
            background: #ffaaaa;
            padding: 5px 10px;
            text-align: center;
            -moz-border-radius: 10px;
        }
{{/HAS_ERROR}}
    </style>
</head>
<body>

<div id="body">

{{#HAS_ERROR}}
    <div class="error">{{error}}</div>
{{/HAS_ERROR}}

Last Accessed: {{last_accessed}} UTC

{{#AUTHENTICATED_PAGE}}
    {{! This is a comment. Note that the ":h" below is a modifier that HTML-encodes the email address.}}
    <p>Hello, <a href="mailto:{{user_email:h}}">{{user_name:h}}</a> from {{user_location}}!</p>
    <p><a href="?logout">Log Out</a></p>
{{/AUTHENTICATED_PAGE}}

{{#DEFAULT_PAGE}}
    <p>Hello, world.</p>
{{/DEFAULT_PAGE}}

{{#LOGIN_FORM}}
    <p>Log in below.</p>

    <form id="login-form" method="post">
        <div>
            <label for="name">Name:</label>
            <input type="text" id="name" name="name" value="{{user_name}}">
        </div>
        <div>
            <label for="pass">Password:</label>
            <input type="password" id="pass" name="pass" value="">
        </div>
        <input type="hidden" name="login" value="1">
        <input type="submit" name="submit" value="Submit">
    </form>
{{/LOGIN_FORM}}
</div>

</body>
</html>
Back to Top