写php分页时出现的Fatal error的解决方法

  作者:bea

Fatal error: Cannot redeclare htmtocode() (previously declared in D:www_localmytestconn.php:7) in D:www_localmytestconn.php on line 10 这个错误提示出现在写分页文件page.php时 google翻译这句话的意思是“致命错误:不能重新声明htmtocode()” 第10行的代码为 <body> <?php //连接数据库 in
Fatal error: Cannot redeclare htmtocode() (previously declared in D:www_localmytestconn.php:7) in D:www_localmytestconn.php on line 10



这个错误提示出现在写分页文件page.php时



google翻译这句话的意思是“致命错误:不能重新声明htmtocode()”



第10行的代码为



<body>

<?php



//连接数据库



include("conn.php");

//引入分页类文件



include("page.class.php");



?>



在网上搜了一下,可能的原因是:两个页面程序文件引用而导致在内存中被重复加载时引发冲突



解决方法:用include_once()代替include


有用  |  无用

猜你喜欢