我正在尝试制作一个捐赠中心,我使用了Tutorialzine的源代码。
到目前为止,一切都很好,但唯一困扰我的问题是,我一整天都在尝试查找并且无法确定代码出了什么问题。
当我的访问者捐款并提交评论时,我看到了以下内容:
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/