PHP 到 Python 服务器页面,退出,停止页面加载
我试图找到相当于 php 的 exit 命令来停止页面加载。例如我有:
if(isset($_SESSION['username'])){
}
else{
echo 'Your session has expired, please click <a href="https://dev.test.com/">here</a>';
exit;
}
注意 else 子句上的退出..它将停止加载页面的其余部分。
有没有办法在 mod_pythong psp <% exit %>
Sys.exit(0) 中执行此操作,因为现在我收到 HTTP 500 错误,即使日志
[Tue Mar 15 15:36:11 2011] [error] [client
10.184.98.38] PythonHandler mod_python.psp: File "/var/www/html/index.psp", line 38, in ?\n sys.exit(0) [Tue Mar 15 15:36:11 2011] [error] [client
10.184.98.38] PythonHandler mod_python.psp: SystemExit: 0
I am trying to find the equivalent to php's exit command to stop a page from loading. For example I have:
if(isset($_SESSION['username'])){
}
else{
echo 'Your session has expired, please click <a href="https://dev.test.com/">here</a>';
exit;
}
Notice the exit on the else claus..it will stop the rest of the page from loading.
Is there a way to do this in mod_pythong psp <% exit %>
Sys.exit(0) doesn't seem to work because now i get a HTTP 500 error, even though the logs
[Tue Mar 15 15:36:11 2011] [error] [client
10.184.98.38] PythonHandler mod_python.psp: File "/var/www/html/index.psp", line 38, in ?\n sys.exit(0) [Tue Mar 15 15:36:11 2011] [error] [client
10.184.98.38] PythonHandler mod_python.psp: SystemExit: 0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样的东西怎么样,使用
sys.exit
:传递给 exit 的数字是退出代码 - 通常,如果没有错误,则为 0。
What about something like this, using
sys.exit
:The number passed to exit being the exit code -- generally, 0 when there is no error.