doujin8476 2011-03-08 19:32
浏览 89
已采纳

不推荐使用:函数eregi()已弃用[重复]

This question already has an answer here:

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

Deprecated: Function eregi() is deprecated in C:\xampp\htdocs\speedyautos\admincp\system_cls.php on line 152 (lines 152-155 shown)

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

Deprecated: Function eregi() is deprecated in C:\xampp\htdocs\speedyautos\admincp\system_cls.php on line 177 (lines 177-184 shown)

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") . "\";");
                }
}

Deprecated: Function eregi() is deprecated in C:\xampp\htdocs\speedyautos\admincp\func.php on line 447 (lines 442-451 shown)

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;
}

many thanks in advance!

</div>
  • 写回答

5条回答 默认 最新

  • dstew32424 2011-03-08 19:36
    关注

    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'])
    

    use

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

    . With preg_match, this would look like this:

    !preg_match('/install/i', $_SERVER['PHP_SELF'])
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 活动选择题。最多可以参加几个项目?
  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀
  • ¥15 flink cdc无法实时同步mysql数据