Exemplo n.º 1
0
#!/usr/bin/python
print 'content-type: text/html'
print

import mod,cgitb
cgitb.enable()
if mod.checklog():
	mod.swagin()
	username = mod.par('username')
	magic = mod.par('id')
	print '''
<html>
<head>
<title>Home</title>
<link rel="stylesheet" type="text/css" href="profile.css">
<LINK REL="SHORTCUT ICON" HREF="favicon.png">
</head>
<body>
'''+mod.nav()+'''
<center>
<form action="addfunc.py" method="get">
Name of Show:<input type="text" name="showname"><br><br>
Synopsis (optional):<br>
<textarea name="synopsis" cols="50" rows="5"></textarea>
<input type="hidden" name="username" value="'''+username+'''">
<input type="hidden" name="id" value="'''+magic+'''"><br>
<table class="hometable"><col width="400"><tr><td><font size="1">
* Please be respectful and add shows that exist. Try to use the original Japanese name and capitalize the first letter of each word. Any griefers will be banished for eternity
</font></td></td></table>
<input type="submit" value="Make Post" class="post">
</form>
Exemplo n.º 2
0
#!/usr/bin/python
print 'content-type: text/html'
print

import mod,cgitb,cgi
cgitb.enable()

form = cgi.FieldStorage()
username=form['username'].value
userid=form['id'].value
if mod.checklog() and len(form)==4:
        mod.swagin()
        username=form['username'].value
        userid=form['id'].value
        propic=form['propic'].value
        desc=form['description'].value
        desc=desc.replace('\n','!n').replace(':','!col')
        
        f=open("users.txt",'r')
	s=f.readlines()
	f.close()
	users=[]
	for i in s:
	    users.append(i.strip('\n').strip().split(':'))

	i=0
	while i<len(users):
	    if users[i][0]==username:
                num=i
            i=i+1