不推荐使用:不推荐使用函数eregi() [英] Deprecated: Function eregi() is deprecated

查看:147
本文介绍了不推荐使用:不推荐使用函数eregi()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在服务器上设置的这些admincp文件中也出现了相同的错误.我该如何解决?

the same error has propped up within these admincp files i am trying to set up on my server. how can i resolve them?

已弃用:函数eregi()在第152行的C:\ xampp \ htdocs \ speedyautos \ admincp \ system_cls.php中已弃用(显示了152-155行)

if (!eregi("install", $_SERVER['REQUEST_URI']) && !eregi("install", $_SERVER['PHP_SELF']))
                {
                                exit("No " . TABLE_PREFIX . "db.php Present. Please run Install first");
                }

已弃用:函数eregi()在行177的C:\ xampp \ htdocs \ speedyautos \ admincp \ system_cls.php中已弃用(显示了行177-184)

if (!eregi("install", $_SERVER['REQUEST_URI']) && !eregi("install", $_SERVER['PHP_SELF']) && !eregi("upgrade", $_SERVER['PHP_SELF']) && !eregi("admincp", $_SERVER['REQUEST_URI']) && !eregi("searchjs.php", $_SERVER['REQUEST_URI']) && !eregi("locationjs.php", $_SERVER['REQUEST_URI']))
{
                register_shutdown_function("SysTime");
                if (!verifysession() && ($SystemInfo->_systemstatus['User_Signup'] != "F" || $SystemInfo->_systemstatus['Seller_Signup'] != "F" || $SystemInfo->_systemstatus['Dealer_Signup'] != "F"))
                {
                                eval("\$loginlink = \"" . $Template->gettemplate("register_link") . "\";");
                }
}

已弃用:函数eregi()在447行的C:\ xampp \ htdocs \ speedyautos \ admincp \ func.php中已弃用(显示了442-451行)

if (!$GLOBALS['noshutdownfunc'])
                {
                                register_shutdown_function("CleanSessionTbl");
                }

} elseif (!eregi("install", $_SERVER['REQUEST_URI']) AND !eregi("install", $_SERVER['PHP_SELF']))
{
                echo "Please delete the install.php file";
                exit;
}

非常感谢!

推荐答案

通常,您应该使用

Normally, you should use the preg_* family of regular expression matching. However, most of your ereg calls actually just search case insensitive. Instead of

!eregi("install", $_SERVER['PHP_SELF'])

使用

stripos($_SERVER['PHP_SELF'], 'install') === false

.使用 preg_match 时,看起来像这样:

. With preg_match, this would look like this:

!preg_match('/install/i', $_SERVER['PHP_SELF'])

这篇关于不推荐使用:不推荐使用函数eregi()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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