douwen7475 2012-07-17 12:24
浏览 7
已采纳

我有自己的PHP函数有这个错误[关闭]

I have this function:

function OUTconf($conf_name){
    $sql = mysql_query("SELECT CONF_VALUE FROM ".prefix."CONFIG WHERE CONF_NAME='".$conf_name."'") or die(mysql_error());
    $rs  = mysql_fetch_assoc($sql);
    $val = $rs['CONF_VALUE'];
    return $val;
}

and I have this html form:

<html>
<head>
    <title> <? OUTconf("SITE_TITLE"); ?> </title>
</head>
<body>
<? echo 'hello !!'; ?>
</body>
</html>

but when i test the code i got this error:

Fatal error: Cannot redeclare outconf() (previously declared in C:\AppServ\www\pv\includes\functions.php:13) in C:\AppServ\www\pv\includes\functions.php on line 18


can anyone help me?

  • 写回答

2条回答 默认 最新

  • douquanjie9326 2012-07-17 12:26
    关注

    Fatal error: Cannot redeclare outconf() (previously declared in C:\AppServ\www\pv\includes\functions.php:13) in C:\AppServ\www\pv\includes\functions.php on line 18

    This means that functions.php is trying to declare the function OUTconf() while it's already declared (by the same script).

    Most probably you are including functions.php twice. Try using include_once instead of include.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Centos7 / PETGEM
  • ¥15 csmar数据进行spss描述性统计分析
  • ¥15 各位请问平行检验趋势图这样要怎么调整?说标准差差异太大了
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
  • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗
  • ¥15 运动想象脑电信号数据集.vhdr
  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗