source: companies/celepar/news_admin/templates/celepar/fckeditor/to_delete/_samples/py/sampleposteddata.py @ 763

Revision 763, 1.9 KB checked in by niltonneto, 15 years ago (diff)

Importação inicial do Expresso da Celepar

Line 
1#!/usr/bin/env python
2
3"""
4FCKeditor - The text editor for internet
5Copyright (C) 2003-2006 Frederico Caldeira Knabben
6
7Licensed under the terms of the GNU Lesser General Public License:
8                http://www.opensource.org/licenses/lgpl-license.php
9
10For further information visit:
11                http://www.fckeditor.net/
12
13"Support Open Source software. What about a donation today?"
14
15File Name: sampleposteddata.py
16        This page lists the data posted by a form.
17
18File Authors:
19                Andrew Liu (andrew@liuholdings.com)
20"""
21
22import cgi
23import os
24
25# Tell the browser to render html
26print "Content-Type: text/html"
27print ""
28
29try:
30        # Create a cgi object
31        form = cgi.FieldStorage()
32except Exception, e:
33        print e
34
35# Document header
36print """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
37<html>
38        <head>
39                <title>FCKeditor - Samples - Posted Data</title>
40                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
41                <meta name="robots" content="noindex, nofollow">
42                <link href="../sample.css" rel="stylesheet" type="text/css" />
43        </head>
44        <body>
45"""
46
47# This is the real work
48print """
49                <h1>FCKeditor - Samples - Posted Data</h1>
50                This page lists all data posted by the form.
51                <hr>
52                <table width="100%" border="1" cellspacing="0" bordercolor="#999999">
53                        <tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999">
54                                <td nowrap>Field Name&nbsp;&nbsp;</td>
55                                <td>Value</td>
56                        </tr>
57"""
58for key in form.keys():
59        try:
60                value = form[key].value
61                print """
62                                <tr>
63                                        <td valign="top" nowrap><b>%s</b></td>
64                                        <td width="100%%">%s</td>
65                                </tr>
66                        """ % (key, value)
67        except Exception, e:
68                print e
69print "</table>"
70
71# For testing your environments
72print "<hr>"
73for key in os.environ.keys():
74        print "%s: %s<br>" % (key, os.environ.get(key, ""))
75print "<hr>"
76
77# Document footer
78print """
79        </body>
80</html>
81"""
Note: See TracBrowser for help on using the repository browser.