- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我正在尝试使用 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! »</a>';
}
}
}
?>
我的 phpMyAdmin 中的数据库已上传完成
这里是我按照安装说明操作的地方
http://tutorialzine.com/2010/05/donation-center-php-mysql-paypal-api/
最佳答案
mb_strlen()
函数在 PHP 中默认不启用。安装详情请阅读手册:
关于php - fatal error : Call to undefined function mb_strlen(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6419102/
在 PHP 中计算 UTF-8 字符串的长度时,我使用 mb_strlen()。 例如: if (mb_strlen($name, 'UTF-8') < 3) { $error .= 'Nam
我如何知道 $_REQUEST 中的字符集?以及如何设置 $_REQUEST 的字符集? 最佳答案 简而言之:您并不真正了解通过 GET 或 POST 传递给 PHP 脚本的变量所使用的编码(字符集)
我使用 document.getElementById("text").value.length 通过 javascript 获取字符串长度,以及 mb_strlen($_POST['text'])通
当我在字符串上运行 PHP 函数 strlen() 和 mb_strlen() 时,它们都返回了错误的字符数。 这是我正在使用的一段代码... $foo = mb_strlen($itemDetai
有一些遗留代码,我应该将其从 iso-8859-2 转换为 UTF-8。其中一个问题是 strlen 函数的广泛使用。我首先想到的是将所有出现的 strlen 替换为 mb_strlen。 但是,我的
使用 PHP,我试图确定如下字符串的长度(字符数): 1 1.1 1.1.1 1.1.2 1.1.3 1.1.3.1 1.1.3.2 1.1.4 1.1.5 1.1.6 1.1.7 等等 当用mb_s
你知道如何在JS中像PHP中的mb_strlen函数一样检查字符长度吗?我刚刚知道使用这种方式,它计算的是字节而不是字符。非常感谢! $(".textarea").val().length 最佳答案
我使用document.getElementById("text").value.length通过javascript获取字符串长度,以及mb_strlen($_POST['text'])通过PHP获
我正在尝试删除字符串的第一个和最后一个字符。我正在经历奇怪的事情。 一探究竟: $string = 'This is a test.'; $string = mb_substr($string, 1,
我正在尝试使用 Totorialzine 的源代码创建一个捐赠中心。 到目前为止,我现在一切正常,但唯一的问题是我一直在努力解决并试图查看一整天,并且无法弄清楚代码到底出了什么问题 这是我在访问者捐款
我有这个自定义编译的 PHP (v5.3.3),启用了以下扩展(通过配置): ./configure --prefix=/usr/local/php5.3.3 --with-config-file-p
我正在使用 JavaScript 和 PHP 来计算字符串长度。一切正常,除了当我计算来自 Chrome 或 Firefox 与 Internet Explorer 的文本区域字符串长度时。新的文本区
我安装的 Yii 直到今天都运行良好。我今天在我的机器上安装了更新,之后所有页面都抛出了这个错误: PHP Fatal Error – yii\base\ErrorException Uncaught
我如何在 PHP 中添加对传递的 $username 长度的检查。该站点是 UTF-8,但我相信 Javascript 使用的是不同的编码。您可以在评论中看到我在 PHP 中尝试了不同的东西但它们不起
我是一名优秀的程序员,十分优秀!