Form中action的参数限制

今天遇到的一个问题及其解决。 这样的一个表单: <form method=post action="/post.php?_in_form=123">... 在server端: <? //取不到$_GET['_in_form']! ?> 查了一些资料 参考: Methods GET and POST in HTML forms - what’s the difference? 关于GET和POST,数据的不同处理 If the method is "get" - -, the user agent takes the value of action, appends a ? to it, then appends the form data set, encoded using the application/x-www-form-urlencoded content type. The user agent then traverses the link to this URI. In this scenario, form data are restricted to ASCII codes. * If the method is "post" --, the user agent conducts an HTTP post transaction using the value of the action attribute and a message created according to the content type specified by the enctype attribute. 结论: get形式的from中,action中的get参数是不会传递的,应该把需要的附加参数作为form隐藏域处理 ...

May 18, 2009 · notsobad

ubuntu 9.04 的新notify的python示例

ubuntu的通知机制 参考: https://wiki.ubuntu.com/NotifyOSD https://wiki.ubuntu.com/NotificationDevelopmentGuidelines 下面是一个简单的python脚本,利用这个新的notify。 效果: https://wiki.ubuntu.com/NotificationDevelopmentGuidelines?action=AttachFile&do=get&target=icon-summary-body.png #!/usr/bin/python import sys import time import pynotify if __name__ == '__main__': if not pynotify.init ("update-notifications"): sys.exit (1) # try the icon-summary-body case n = pynotify.Notification ( "Inital notification", "This is the original content of this notification-bubble.", "notification-message-IM") n.show () time.sleep (3); # simulate app activity # update the current notification with new content n.update ("Updated notification", "Here the same bubble with new title- and body-text, even the icon can be changed on the update.", "notification-message-email") n.show (); time.sleep (6); # wait longer now # create a new bubble using the icon-summary-body layout n = pynotify.Notification ( "Initial layout", "This bubble uses the icon-title-body layout.", "notification-message-IM"); n.show () time.sleep (3); # simulate app activity # now update current bubble again, but change the layout n.update ("Updated layout", "After the update we now have a bubble using the title-body layout.") n.show ()

May 17, 2009 · notsobad

Django on londit

浪点空间上,使用django #获取django svn 版本: mkdir script && cd script svn co http://code.djangoproject.com/svn/django/trunk/ django-trunk mkdir django-project && cd django-project django-admin startproject notsobad 最后: 设置.htaccess SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE notsobad.settings PythonPath "['/home/virtualhost/lnotsoba/script/django-trunk','/home/virtualhost/lnotsoba/script/django-project']+sys.path" PythonDebug On 参考: http://www.londit.cn/FAQ/Python http://docs.djangoproject.com/en/dev/topics/install/

May 12, 2009 · notsobad

shell中01-20列表的创建

chinaunix上的一个帖子: http://bbs2.chinaunix.net/viewthread.php?tid=1443099&extra=&page=1 我要快速创建20个文件,test_01.txt。。。。test_20.txt, 01-20这个怎么处理,1..20只是1 2 3 4 5 6 7 。。。20,个位数的时候没有前面的0. 不符合要求。 请求高手指点。 下面是一些不同的做法 ...

May 3, 2009 · notsobad

我的定时脚本

高亮版本看[这里 ](http://not- sobad.appspot.com/show_code/?key=aglub3Qtc29iYWRyCwsSBENvZGUY8WAM)。 作用就是 11,15,18,20,23等几个时间点执行我的脚本。 #!/bin/sh #cron.sh #浪点空间不支持crontab #blog数据同步脚本需要每隔几个小时执行一次,所以自己写了一个简单的 #usage: #nohup cron.sh &>/dev/null & get_local_hour(){ if ! date|grep UTC >/dev/null;then date +%H return 0 fi d=$(expr `date +%H` + 8) if [ $d -gt 24 ];then d=$(expr $d - 24) fi echo $d } cd $HOME/script || exit 1 while [ 1 ];do if ( (echo 11,15,18,20,23 | grep `get_local_hour` >/dev/null ) );then [ -s .rpc_end_link -a -f wp.py ] || exit 2 python wp.py 2>&1 >wp.log fi sleep 3600 done exit 0 后记:白忙了,还不如这样搞。 ...

April 30, 2009 · notsobad