我正在尝试建立一个捐赠中心,使用的是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中未启用该功能。请阅读手册以获取安装详细信息:
mb_strlen()
http://www.php.net/manual/zh/mbstring.installation.php