<? php  ==>  <?php
试试

解决方案 »

  1.   

    count.txt文件有问题吧,它说不能打开文件呀
      

  2.   

    echo(" you are $string to visit this web");
    这句子哪里有写错呢?
    调试出来的结果是:
    you are to visit this web怎么没读出$string这个字符串的值呢?
      

  3.   

    <? php  $fp = fopen("count.txt","r");
      $str1= fgets($fp,10);
      $str1++;//这里有问题,如果你的$str1为字符,+1表示什么??你想把文件读到一个数组中,不如这样
    /*
    while(!feof($fp))
    {
    $str1[$i]= fgets($fp,10);
    $i++;
    }
    */
      fclose($fp);
      $fp = fopen("count.txt","w");
      fputs($fp,$str1);
      fclose($fp);
      $len1=strlen($str1);
      $str2="000000000";
      $len2=strlen($str);
      $dif=$len2-$len1;
      $rest=substr($str2,0,$dif);
     $string=$rest.$strl;
    echo(" you are $string to visit this web");//把这里改成echo " you are". $string." to visit this web";看看//?>
      

  4.   

    <?php  $fp = fopen("count.txt","r");
      $str1= fgets($fp,10);
      if ($str1 == "") $str1 = 0;
      $str1++;
      fclose($fp);
      $fp = fopen("count.txt","w");
      fputs($fp,$str1);
      fclose($fp);
      $len1=strlen($str1);
      $str2="000000000";
      $len2=strlen($str);
      $dif=$len2-$len1;
      $rest=substr($str2,0,$dif);
     $string=$rest.$str1;   //以后不要在把$str1写成$strl了!!!
    echo(" you are $string to visit this web");
    ?>
      

  5.   

    echo " you are $string to visit this web";
    or
    echo " you are". $string. "to visit this web";
      

  6.   

    谢谢,blueaurora(蓝色极光) 
    可以啦。