gpt4 book ai didi

php - fatal error : Call to undefined function mb_strlen()

转载 作者:IT老高 更新时间:2023-10-28 12:05:16 29 4
gpt4 key购买 nike

我正在尝试使用 Totorialzine 的源代码创建一个捐赠中心。

到目前为止,我现在一切正常,但唯一的问题是我一直在努力解决并试图查看一整天,并且无法弄清楚代码到底出了什么问题

这是我在访问者捐款时在页面上提交评论时得到的结果。

Fatal error: Call to undefined function mb_strlen() in /home/yoursn0w/public_html/livetv/premium/thankyou.php on line 14

这是php文件中的代码。

<?php

require "config.php";
require "connect.php";

if(isset($_POST['submitform']) && isset($_POST['txn_id']))
{
$_POST['nameField'] = esc($_POST['nameField']);
$_POST['websiteField'] = esc($_POST['websiteField']);
$_POST['messageField'] = esc($_POST['messageField']);

$error = array();

if(mb_strlen($_POST['nameField'],"utf-8")<2)
{
$error[] = 'Please fill in a valid name.';
}

if(mb_strlen($_POST['messageField'],"utf-8")<2)
{
$error[] = 'Please fill in a longer message.';
}

if(!validateURL($_POST['websiteField']))
{
$error[] = 'The URL you entered is invalid.';
}

$errorString = '';
if(count($error))
{
$errorString = join('<br />',$error);
}
else
{
mysql_query(" INSERT INTO dc_comments (transaction_id, name, url, message)
VALUES (
'".esc($_POST['txn_id'])."',
'".$_POST['nameField']."',
'".$_POST['websiteField']."',
'".$_POST['messageField']."'
)");

if(mysql_affected_rows($link)==1)
{
$messageString = '<a href="donate.php">You were added to our donor list! &raquo;</a>';
}
}
}

?>

我的 phpMyAdmin 中的数据库已上传完成

这里是我按照安装说明操作的地方

http://tutorialzine.com/2010/05/donation-center-php-mysql-paypal-api/

最佳答案

mb_strlen() 函数在 PHP 中默认不启用。安装详情请阅读手册:

http://www.php.net/manual/en/mbstring.installation.php

关于php - fatal error : Call to undefined function mb_strlen(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6419102/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com