从python cgi页面重定向到另一个没有超链接的页面 [英] redirection from a python cgi page to another page without hyperlinks

查看:124
本文介绍了从python cgi页面重定向到另一个没有超链接的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下问题.我有我的脚本login.py 还有两个页面,login.html和welcome.html. 当我使用电子邮件ID和密码登录login.html时,login.py将从mysql中提取确切的用户信息.现在,我想从login.cgi开始welcome.html页面,并通过参数传递用户信息,并将其显示在Welcome页面上. 谁能帮我解决这个问题,如何编写python cgi吗?

I have the following problem. I have my script login.py and two pages, login.html and welcome.html. When I log in login.html with email-id and password, then login.py would extract exact user information from mysql. Now I'd like start welcome.html page from login.cgi and passing user information through parameters and display it on welcome page. Can anybody help me, to solve this problem how to write the python cgi ?

我真正的意思是:您在jsp中有向前动作以执行此操作.... python cgi中有没有类似的东西... ??

what i actually mean is: you have forward action in jsp to do this.... is there anything similar in python cgi...??

推荐答案

http 确实支持重定向,并将其作为协议的一部分.这些是3xx响应.

http does support redirect as part of the protocol. Those are the 3xx responses.

在POST请求之后,您可能会回复 HTTP 303参见其他以重定向到登录后输入正确的文件.您可以像往常一样传递参数.

After a POST request, you will probably reply with HTTP 303 See other to redirect to the correct document after login. You may pass parameters as usual.

print "HTTP/1.1 303 See Other"
print "Location: http://example.org/other?user=xyz"


请参见使用CGI Python将网页重定向到主页

这篇关于从python cgi页面重定向到另一个没有超链接的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆