About exec() function
| From: | Zhu bo | Date: | Wed, 05 Jul 2000 03:06:54 +0000 |
| Subject: | About exec() function | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-855@lists.php.net to get a copy of this message | ||
Hi,
When I run following sample in my php enviroment,my pc will wait for a long time ,maybe the
problem is in exec( "del $counterFile");
,could your tell me right answer?
The following is this sample.
<?php
$counterFile = "counter.txt";
$fp = fopen($counterFile,"rw");
$a=file_exists($counterFile);
exec( "del $counterFile");
function displayCounter($counterFile) {
$fp = fopen($counterFile,"rw");
$num = fgets($fp,5);
$num += 1;
print "您是第 "."$num"." 位无聊份子";
exec( "del $counterFile");
exec( "echo $num > $counterFile");
}
if (!file_exists($counterFile)) {
exec( "echo 0 > $counterFile");
}
displayCounter($counterFile);
?>