Ali*_*Ali 60 php mysql database
我正在尝试建立一个捐赠中心,我使用Totorialzine的源代码.
到目前为止,这一切对我来说都很好,但是我唯一的问题是努力工作并试图查看一整天并且无法确切地知道代码究竟是什么问题
这是我在访客捐赠时在页面上提交评论时得到的内容.
Fatal error: Call to undefined function mb_strlen() in /home/yoursn0w/public_html/livetv/premium/thankyou.php on line 14
Run Code Online (Sandbox Code Playgroud)
这是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>';
}
}
}
?>
Run Code Online (Sandbox Code Playgroud)
我在phpMyAdmin上传完成了我的数据库
这是我按照安装说明进行操作的地方
http://tutorialzine.com/2010/05/donation-center-php-mysql-paypal-api/
AJ.*_*AJ. 72
mb_strlen()PHP中默认不启用该功能.请阅读手册了解安装细节:
http://www.php.net/manual/en/mbstring.installation.php
小智 29
要修复此安装php7.0-mbstring包:
sudo apt install php7.0-mbstring
Run Code Online (Sandbox Code Playgroud)
在Centos,RedHat,Fedora和其他yum-my系统上,它比PHP手册所建议的简单得多:
yum install php-mbstring
service httpd restart
Run Code Online (Sandbox Code Playgroud)
对我来说,这适用于Ubuntu 14.04和php5.6:
$ sudo apt-get install php5.6-mbstring
Run Code Online (Sandbox Code Playgroud)
这个问题看起来与 Unix 上的 PHP 有关。但是,对于任何在 Windows 上遇到 PHP 问题的人,请参阅https://www.php.net/manual/en/install.pecl.windows.php。
由于多字节字符串支持是核心 PHP 扩展,因此在 Windows 上只需取消注释以下行php.ini:
extension=php_mbstring.dll
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
97611 次 |
| 最近记录: |