致命错误:在第18行的/home/content/09/11761709/html/student/includes/menu.php中调用未定义的函数client_data()
当用户单击“上载新项目”按钮时发生致命错误,它会抛出以下消息: 致命错误:在第18行的/home/content/09/11761709/html/student/includes/menu.php中调用未定义的函数client_data() 这两个页面上使用的代码是:Menu.php和upload.item.php **upload.item.php的代码**致命错误:在第18行的/home/content/09/11761709/html/student/includes/menu.php中调用未定义的函数client_data(),php,Php,当用户单击“上载新项目”按钮时发生致命错误,它会抛出以下消息: 致命错误:在第18行的/home/content/09/11761709/html/student/includes/menu.php中调用未定义的函数client_data() 这两个页面上使用的代码是:Menu.php和upload.item.php **upload.item.php的代码** <div id="content"> <!--Top menu--> <?php inc
<div id="content">
<!--Top menu-->
<?php include('../includes/menu.php'); ?>
<!--End menu-->
<div class="clear"></div>
<div class="space_top"></div>
<!--Sidebar-->
<div id="sidebar">
<?php include('../customers/sidebar.php'); ?>
</div>
<!--End Sidebar-->
<script type="text/javascript" src="../js/tinymce/tinymce.min.js"></script>
<script>
tinymce.init({
selector: "textarea#id1",
theme: "modern",
width: 550,
height: 150,
plugins: [
"advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"save table contextmenu directionality emoticons template paste textcolor"
],
content_css: "css/content.css",
toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | link image | print preview media fullpage | forecolor backcolor emoticons",
style_formats: [
{title: 'Bold text', inline: 'b'},
{title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
{title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
{title: 'Example 1', inline: 'span', classes: 'example1'},
{title: 'Example 2', inline: 'span', classes: 'example2'},
{title: 'Table styles'},
{title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
]
});
</script>
<div id="incontent">
<?php
$select_news = mysql_query("SELECT * FROM news where id='" . $_GET['nid'] . "' and status = '1'");
while ($arr = mysql_fetch_array($select_news)) {
$title = $arr['title'];
$text = $arr['content'];
}
?>
<div class="uih-widget ui-state-default ui-state-active ui-corner-top box_shadow full_el left"><?php echo titles_upload_item; ?></div>
<div class="co_box ui-corner-bottom full_el left" style="min-height:500px">
<form id="fileupload" action="" method="post" enctype="multipart/form-data" style="width:500px">
<input type="hidden" name="author" value="<?php echo $user_id; ?>">
<?php echo $mes; ?>
<div class="clear"></div>
<div class="t10"></div>
<table style="width:100%;border:0px;" cellspacing="10" class="pro_form">
<tr>
<td><?php echo titles_upload_title; ?></td><td class="reg_form_td"><input type="text" name="name" value="<?php echo $name; ?>" autocomplete="off"></td>
</tr>
<tr>
<td><?php echo titles_upload_category; ?></td>
<td><select style="width:150px" type="select" name="cat_name" onChange="getCat('../includes/find.subcat.php?cat_name=' + this.value)">
<option><?php echo titles_upload_scategory; ?></option>
<?php
$sel_cat = mysql_query("SELECT * FROM categories");
while ($cat_data = mysql_fetch_array($sel_cat)) {
$cat_name = $cat_data['name'];
$cat_id = $cat_data['id'];
echo '<option value="' . $cat_id . '">' . $cat_name . '</option>';
}
?>
</select>
</td>
</tr>
<tr>
<td><?php echo titles_upload_subcategory; ?></td>
<td>
<div id="subcategory">
<select style="width:150px" type="select" name="scat_name">
<option value="0"><?php echo titles_upload_selsubcategory; ?></option>
</select>
</div>
</td>
</tr>
<tr>
<td valign="top"><?php echo titles_upload_desc; ?></td><td><textarea id="id1" type="textarea" name="descr"></textarea></td>
</tr>
<tr>
<td><?php echo titles_upload_thumb; ?></td><td><input type="file" name="thumb" value=""> <span> (JPEG or PNG 80x80px Thumbnail)</span></td>
</tr>
<tr>
<td><?php echo titles_upload_prev; ?></td><td><input type="file" name="prv" value=""> <span> (590x300 JPEG)</span></td>
</tr>
<tr>
<td><?php echo titles_upload_files; ?>(zip)</td><td><input type="file" name="zip" value=""><span>ZIP - All your item files</span></td>
</tr>
<tr>
<td><?php echo titles_upload_scr; ?></td><td><input type="file" name="scr[]" multiple> <span>Select multiple screenshots</span></td>
</tr>
<tr>
<td><?php echo titles_upload_demo; ?></td><td class="reg_form_td"><input type="text" name="demo" value="<?php echo $demo; ?>" autocomplete="off"></td>
</tr>
<tr>
<td valign="top"><?php echo titles_upload_mes; ?></td><td class="reg_form_td"><textarea style="min-height:100px" type="textarea" name="rev_mes"><?php echo $msg_rev; ?></textarea> </td>
</tr>
<tr>
<td></td><td><input type="submit" name="add" class="menu uih-widget pointer ui-state-default ui-corner-all pl15 pr15" value="Upload"></td>
</tr>
</table>
</form>
</div>
<script>
function getXMLHTTP() { //function to return the xml http object
var xmlhttp = false;
try {
xmlhttp = new XMLHttpRequest();
}
catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e1) {
xmlhttp = false;
}
}
}
return xmlhttp;
}
function getCat(strURL) {
var req = getXMLHTTP();
if (req) {
req.onreadystatechange = function() {
if (req.readyState == 4) {
// only if "OK"
if (req.status == 200) {
text = document.getElementById('subcategory').innerHTML = req.responseText;
//alert(text);
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText);
}
}
}
req.open("GET", strURL, true);
req.send(null);
}
}
</script>
</div>
<div class="clear"></div>
<?php include('../includes/footer.php'); ?>
<div class="clear"></div>
</body>
</html>
tinymce.init({
选择器:“文本区域#id1”,
主题:“现代”,
宽度:550,
身高:150,
插件:[
“advlist autolink图像列表charmap打印预览hr锚定页面中断拼写检查器”,
“searchreplace wordcount visualblocks visualchars代码全屏插入日期时间媒体非中断”,
“保存表格上下文菜单方向性表情模板粘贴文本颜色”
],
content\u css:“css/content.css”,
工具栏:“插入文件撤消重做|样式选择|粗体斜体|对齐左对齐居中对齐右对齐对齐对齐|粗体数字列表|链接图像|打印预览媒体全页|前景色背景表情”,
样式和格式:[
{标题:“粗体文本”,内联:“b'},
{标题:'Red text',内联:'span',样式:{color:'#ff0000'}},
{title:'Red header',block:'h1',style:{color:'#ff0000'}},
{title:'example1',inline:'span',classes:'example1'},
{title:'example2',inline:'span',classes:'example2'},
{title:'表格样式'},
{title:'Table row 1',选择器:'tr',类:'tablerow 1'}
]
});
(JPEG或PNG 80x80px缩略图)
(590x300 JPEG)
(zip)zip-您的所有项目文件
选择多个屏幕截图
只要读一下错误
要调用的函数不存在:client\u data()
您可能需要创建它,或者包含或需要包含它的文件。
您在文件中调用了此函数两次。代码太多了。您确定不能简化或只是发布一个需要帮助的代码片段:)您尝试调用的函数未定义。您可能拼写错误了函数名,或者忘记了包含包含函数定义的文件。
<div id="nx_menu" class="ui-state-default ui-corner-all">
<?php if (isset($_SESSION['user_id'])) { ?>
<a class="menu optim ui-state-default left l5 p10 <?php echo ($active_page == 'index' ? 'active' : ''); ?>" href="<?php echo ROOT_URL; ?>/customers/"><?php echo general_dash; ?></a>
<a class="menu optim ui-state-default left l5 p10 <?php echo ($active_page == 'profile' ? 'active' : ''); ?>" href="<?php echo ROOT_URL; ?>/customers/profile.php"><?php echo general_profile; ?></a>
<a href="<?php echo ROOT_URL; ?>/customers/settings.php" class="menu optim ui-state-default left l5 p10 <?php echo ($active_page == 'settings' ? 'active' : ''); ?>"><?php echo general_settings; ?></a>
<?php if (client_data($user_id, 'author') == 1) { ?>
<a href="<?php echo ROOT_URL; ?>/<?php echo client_data($user_id, 'username'); ?>-portfolio/<?php echo $user_id; ?>" class="menu optim ui-state-default left p10 <?php echo ($active_page == 'user.profile' ? 'active' : ''); ?>"><?php echo general_portfolio; ?></a>
<a href="<?php echo ROOT_URL; ?>/customers/earnings.php" class="menu optim ui-state-default left l5 p10 <?php echo ($active_page == 'earnings' ? 'active' : ''); ?>"><?php echo general_earnings; ?></a>
<a href="<?php echo ROOT_URL; ?>/customers/withdraw.php" class="menu optim ui-state-default left l5 p10 <?php echo ($active_page == 'withdraw' ? 'active' : ''); ?>"><?php echo general_withdraw; ?></a>
<?php } ?>
<form id="form" action="<?php echo ROOT_URL . '/list.items.php'; ?>" method="post">
<a class="menu optim ui-state-default right p10 r10" href="#" onclick="sendForm()"><?php echo general_search; ?></a>
<input class="ui-corner-all right t5 r5" style="width:250px;color:#888;" type="text" name="search" value="">
</form>
<?php } else { ?>
<a href="<?php echo ROOT_URL; ?>/" class="menu optim ui-state-default left l5 p10 <?php echo ($active_page == 'index' ? 'active' : ''); ?>"><?php echo general_home; ?></a>
<a href="<?php echo ROOT_URL; ?>/browse-items" class="menu optim ui-state-default left l5 p10 <?php echo ($active_page == 'list.items' ? 'active' : ''); ?>"><?php echo general_browse; ?></a>
<a href="<?php echo ROOT_URL; ?>/register.html" class="menu optim ui-state-default left l5 p10 <?php echo ($active_page == 'register' ? 'active' : ''); ?>"><?php echo general_signup; ?></a>
<a href="<?php echo ROOT_URL; ?>/login.html" class="menu optim ui-state-default left l5 p10 <?php echo ($active_page == 'login' ? 'active' : ''); ?>"><?php echo general_login; ?> </a>
<form id="form" action="<?php echo ROOT_URL . '/list.items.php'; ?>" method="post">
<a class="menu optim ui-state-default right p10 r10" href="#" onclick="sendForm()"><?php echo general_search; ?></a>
<input class="ui-corner-all right t5 r5" style="width:250px;color:#888;" type="text" name="search" value="">
</form>
<?php } ?>
<div class="clear"></div>
</div>
<script>
function sendForm() {
document.getElementById("form").submit();
}
</script>