php require 找不到函数
count.php
<?
require("1.inc");
?>
<html>
<title>我的记数器</title>
<body>
你的第 <?php Counter() ?> 访问者.
</body>
</html>
1.inc
<?
function counter()
{
$max_len=8;
$CounterFile="1.data";
if(!file_exists($CounterFile))
{
$Counter=0;
$cf=fopen($CounterFile,"w");
flock($cf,3);
fputs($cf,"0");
fclose($cf);
}
else
{
$cf=fopen($CounterFile,"r");
flock($cf,3);
$Counter=trim(fgets($cf,$max_len));
fclose($cf);
}
if(session_is_registered("in")==false)
{
$Counter++;
$cf=fopen($CounterFile,"w");
flock($cf,3);
fputs($cf,$Counter);
fclose($cf);
}
$Counter_len=strlen($Counter);
for($i=1;$i<=($max_len-$Counter_len);$i++)
{
echo"<img src='img/0.gif'>";
}
for ($i=1;$i<=$Counter_len;$i++)
{
echo "<img src='img/".substr($Counter,$i-1,1).".gif'>";
}
}
?>
页面返回
你的第
Fatal error: Call to undefined function Counter() in D:\Program Files\wamp\www\imagecounter.php on line 7
ps:把函数放进count.php能起作用