Receing a form variable as a list instead of as a string

Νικόλαος Κούρας nikos.gr33k at gmail.com
Tue Jun 11 06:38:27 EDT 2013


page = form.getvalue('page')

if form.getvalue('show') == 'log' or page:
	# it is a python script
	page = page.replace( '/home/nikos/public_html/cgi-bin/', '' )
elif os.path.exists( page ):
	# it is an html template
	page = page.replace( '/home/nikos/public_html/', '' )


============================
[Tue Jun 11 13:35:30 2013] [error] [client 79.103.41.173]   File "/home/nikos/public_html/cgi-bin/metrites.py", line 28, in <module>, referer: http://superhost.gr/
[Tue Jun 11 13:35:30 2013] [error] [client 79.103.41.173]     page = page.replace( '/home/nikos/public_html/', '' ), referer: http://superhost.gr/
[Tue Jun 11 13:35:30 2013] [error] [client 79.103.41.173] AttributeError: 'list' object has no attribute 'replace', referer: http://superhost.gr
=========================

but page is a form variable coming from a previous sumbitted form
why the error says 'page' is a list?

How to receive that form variable as a string?



More information about the Python-list mailing list