如果用你写的这段代码,
那么你的count.php必须输出的是一段JAVASCRIPT代码。
我想你的PHP程序并不是这样写的,
因此你应该改成:
<img src="count.php?uid=u2mcse">
看看行吗?

解决方案 »

  1.   

    <?php
    /* 这里加入从文件或者数据库取得技术器的值,赋给$counter的代码 */
    session_start();
    if (!(session_is_registered($has_been_counted)) {
        $counter++;
        /* 这里加入把$counter重新写入文件或者数据库的代码 */
        $has_been_counted = TRUE;
        session_register($has_been_counted);
    }
    /* 这里加入显示计数器的代码 */
    ?>上面的文件保存为counter.inc.php,在需要使用计数器的地方中加入:
    include "./path/counter.inc.php";
      

  2.   

    用<img src="count.php?uid=u2mcse">是不行的!正确的做法是用输出一段javascript代码!
    例如要输出:
    document.write("<a href='http://210.45.116.60/index.htm' target='_BLANK'><img src='1.gif' width='18' height='18' border=0><img src='0.gif' width='18' height='18' border=0><img src='4.gif' width='18' height='18' border=0><img src='0.gif' width='18' height='18' border=0></a>");
    程序:
    $num=$counter;
    $len=strlen($num);
    $write= 'document.write("';
    $write=$write."<a href='http://210.45.116.60/index.htm' target='_BLANK'>";
      for ($i=0;$i<$len;$i++){
           $write=$write."<img src='".substr($num,$i,1).".gif' width='18' height='18' border=0>";
            };
    $write=$write.'</a>");';
    echo $write;记得一定要加border=0这样才好看,不会有难看的链接边框!
      

  3.   

    re: 用<img src="count.php?uid=u2mcse">是不行的!不一定.这取决你的count.php的输出.
      

  4.   

    对啊~前面我不是说了嘛~
    如果你的PHP程序输出的文件头是gif/jpeg
    那就可以直接用img src来调用啦^_^