【发布时间】:2011-06-21 00:33:11
【问题描述】:
我正在尝试使用 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/
【问题讨论】:
-
php.net/manual/en/mbstring.installation.php - 您需要启用或安装 mbstring PHP 扩展才能使用该功能。
标签: php