[問題] 用cgi.FieldStorage取form時遇到#符號
環境是 WIN2003的IIS + Python
form表單上有 id、pwd、server 三個INPUT
送出 form 表單後 ,用
form=cgi.FieldStorage() 取值
然後 print form 出來看
出現:
FieldStorage(None, None, [MiniFieldStorage('id', 'zzz'),
MiniFieldStorage('pwd', 'xxx')])
而實際上 pwd 的值 應該是 xxx#ccc
井字號之後的資料都不見了
然後在後面處理字串時網頁上會出現
string.upper(string.replace(login_form.getvalue("server"),' ','')) File
"C:\Python22\Lib\string.py", line 370, in replace return s.replace(old, new,
maxsplit) AttributeError: 'NoneType' object has no attribute 'replace'
請問該怎麼處理 # 後面字串不見的狀況?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.211.33.254
→
06/14 10:09, , 1F
06/14 10:09, 1F
→
06/14 10:10, , 2F
06/14 10:10, 2F
→
06/14 10:10, , 3F
06/14 10:10, 3F
→
06/14 10:11, , 4F
06/14 10:11, 4F
推
06/17 02:03, , 5F
06/17 02:03, 5F
→
06/17 02:06, , 6F
06/17 02:06, 6F