致命错误:调用未定义的函数mb_strlen() [英] Fatal error: Call to undefined function mb_strlen()

查看:1725
本文介绍了致命错误:调用未定义的函数mb_strlen()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用捐赠中心,我使用Totorialzine的源代码。

I'm trying to make a donation center which I use the source code from Totorialzine.

到目前为止,一切都对我很好,但唯一的问题我正在努力,试图看一整天,不能确切地说明代码的实际错误。

Everything works fine for me at this moment so far but the only problem I was struggling on and trying to look at for the whole day and can't figure what is actually wrong with the code exactly

这里是我提交时当我的访客捐赠的时候评论页面。

here is what I get when I submit the comment on the page when my visitors donate.

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

这里是php文件中的代码。

and here is the code in the php file.

<?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上传完成的数据库已完成

I have my database in the phpMyAdmin uploaded completed

这里是我遵循安装说明的地方

here is where I follow the instruction of the installation

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

推荐答案

在PHP中默认情况下未启用函数 mb_strlen()。请阅读安装详细信息的手册:

The function mb_strlen() is not enabled by default in PHP. Please read the manual for installation details:

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

这篇关于致命错误:调用未定义的函数mb_strlen()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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