$ HTTP_REFERER像发条一样崩溃我的系统 [英] $HTTP_REFERER crashes my system like clockwork

查看:310
本文介绍了$ HTTP_REFERER像发条一样崩溃我的系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢在我的桌面上开发,然后当我开始工作时,我将

复制到我的网站。


我设置了一个我的windows-2k桌面上的新版本Xampp。并从网站上下载了

的东西进行编辑。在网站上,一切正常,我的桌面上没有任何效果。


我猜这与PHP版本有关。我知道随着新版本推出,PHP会打破

所有内容。


在网站上,我使用的是PHP 4.4.2。在我的桌面上,我正在使用5.1.4。


这是崩溃一切的常规。


#if是空的返回登录页面

if((!$ username)或(!$ password))

{

header( 位置:$ HTTP_REFERER);

退出();

}


同样,这一切都适用于PHP 4 ..4.2,与PHP 5.1.4崩溃。此外,如果我用$ HTTP_REFERER尝试做任何其他事情,系统崩溃。


通过崩溃我的意思是我得到一个空白页面,或者一个错误信息

标题已经加载。

I like to develop on my desktop, then when I get stuff working, I copy
to my web-site.

I set up a new version Xampp on my windows-2k desktop. And downloaded
the stuff from the website to edit. On the website, everything worked,
on my desktop, nothing works.

I am guessing this has to do with PHP versions. I know PHP breaks
everything whenever they come out with a new version.

On the website, I am using PHP 4.4.2. On my desktop, I''m using 5.1.4.

This is the routine that crashes everything.

#if either form field is empty return to the log-in page
if ( (!$username) or (!$password) )
{
header("Location:$HTTP_REFERER");
exit();
}

Again, it all works with PHP 4..4.2, crashes with PHP 5.1.4. Also if I
try to do anything else with $HTTP_REFERER, the system crashes.

By "crashes" I mean I either get a blank page, or an error message that
the headers are already loaded.

推荐答案

用户名)或(!


密码))

{

header(" Location:
password) )
{
header("Location:


HTTP_REFERER");

exit();

}


再次,它都适用于PHP 4..4.2,与PHP 5.1.4崩溃。如果我

尝试用
HTTP_REFERER");
exit();
}

Again, it all works with PHP 4..4.2, crashes with PHP 5.1.4. Also if I
try to do anything else with

这篇关于$ HTTP_REFERER像发条一样崩溃我的系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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