[PHP] about lock some codes.

2012-09-27 Thread lx
Hello: I have a question now.the code is: $ftemp = fopen("$fdoc_tmp/temp_proxy", 'w'); fwrite($ftemp, $content); fclose($ftemp); exec("/usr/local/bin/gdnsproxy -a -f $fdoc_tmp/temp_proxy 1>$fdoc_tmp/dout 2>$fdoc_tmp/derr", $da

[PHP] install PHP 5.4 by RPM

2012-09-24 Thread lx
Hello: I have installed the PHP and Apache by RPM, and the version of rpm packets is: httpd-2.2.3-63.el5.centos.1.x86_64.rpm apr-1.2.7-11.el5_3.1.x86_64.rpm apr-util-1.2.7-11.el5.x86_64.rpm postgresql-libs-8.1.18-2.el5_4.1.x86_64.rpm gmp-4.1.4-10.el5.x86_64.rpm php-common-5.1.6-27.el5.x86_6

[PHP] about PHP's filter_var function

2012-09-20 Thread lx
Hello: I want to use filter_var function by this way: $ip = "192.168.0.1"; if( !filter_var($ip, FILTER_VALIDATE_IP) ) { echo "IP is not valid"; } else {