1.php.ini 中设置 error_reporting  =  E_ALL & ~E_NOTICE 
display_errors = Off
<?php
echo $_SERVER["PHP_SELF"];
?>2. 不知道:(

解决方案 »

  1.   

    第二个问题:
    需要在你操作文件的时候先锁定,操作之后再释放,请参考如下函数以及例子:
    flock
    (PHP 3>= 3.0.7, PHP 4 )flock -- Portable advisory file locking
    Description
    bool flock ( resource handle, int operation [, int &wouldblock])
    PHP supports a portable way of locking complete files in an advisory way (which means all accessing programs have to use the same way of locking or it will not work). flock() operates on handle which must be an open file pointer. operation is one of the following values: To acquire a shared lock (reader), set operation to LOCK_SH (set to 1 prior to PHP 4.0.1). To acquire an exclusive lock (writer), set operation to LOCK_EX (set to 2 prior to PHP 4.0.1). To release a lock (shared or exclusive), set operation to LOCK_UN (set to 3 prior to PHP 4.0.1). If you don't want flock() to block while locking, add LOCK_NB (4 prior to PHP 4.0.1) to operation. 
    flock() allows you to perform a simple reader/writer model which can be used on virtually every platform (including most Unix derivatives and even Windows). The optional third argument is set to TRUE if the lock would block (EWOULDBLOCK errno condition) Returns TRUE on success or FALSE on failure. Example 1. flock() example<?php$fp = fopen("/tmp/lock.txt", "w+");if (flock($fp, LOCK_EX)) { // do an exclusive lock
        fwrite($fp, "Write something here\n");
        flock($fp, LOCK_UN); // release the lock
    } else {
        echo "Couldn't lock the file !";
    }fclose($fp);?>
     
     
    Note: Because flock() requires a file pointer, you may have to use a special lock file to protect access to a file that you intend to truncate by opening it in write mode (with a "w" or "w+" argument to fopen()). 
      

  2.   

    1
    php.ini 中设置 error_reporting  =  E_ALL & ~E_NOTICE 
    display_errors = Off
    对其它会产生影响吗?2
    我想知道 在加入数据库时会不会出现N个人一起上线 只加1的现像 ? 不是问的文本,希望解答。
      

  3.   

    2.会.特别是在上线人数较多时容易发现.
      需要解决并发访问时的锁定问题.不过如果是直接set count=count+1或用其它方法基本可以依赖数据本身的锁机制去避免