您还可以从处理脚本发送HTTP头:
Location: /
在您处理完您的答案后,您将发送上面的标题。我建议您附加一个随机数查询字符串。e、 g.python示例(假设您正在使用python CGI模块):#!/usr/bin/env python
import cgitb
import random
import YourFormProcessor
cgitb.enable() # Will catch tracebacks and errors for you. Comment it out if you no-longer need it.
if __name__ == '__main__':
YourFormProcessor.Process_Form() # This is your logic to process the form.
redirectURL = "/?r=%s" % random.randint(0,100000000)
print 'Content-Type: text/html'
print 'Location: %s' % redirectURL
print # HTTP says you have to have a blank line between headers and content
print ''
print '
'print ' ' % redirectURL
print '
You are going to be redirected'print ' '
print '
'print ' Redirecting... Click here if you are not redirected' % redirectURL
print ' '
print ''