怎么样让PHP在WINDOWS下读盘 把这一句去掉exec( "rm -rf $counterFile");或者换成:exec( "deltree/y $counterFile");谁给我加分数呀? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 忘了一点,偶的也出现dos窗口,98和nt下都是,估计是不治之症。 为什么不用PHP自己带的函数DELETE()呢? 唉,各位大哥大,还是不行呀,调用的话会死机呀唉,我的是PWS+PHP4。0的了我看是说不清楚了,你们那位也是WINDOWS下的PHP能不能把你的PHP程序,不管有多简单,有多请你发我一份好吗??我真的很想学PHP可是网上的资料很少,就是有,也是FOR LINUX的,我这单机总不可能格了装LINUX吧我的E-MAIL是[email protected]谢谢了,谢谢希望你们能帮帮我! 一个PHP的爱好者! 抱歉,我先前用的是php3.0.15+win98+pws。现在用的是nt+iis4.0+php4。结果也出现先前的计数器程序不能运行。偶发现php的文件好像只能分别打开读或写,而不能一次打开,同时读写。偶改了一下程序,铁上来。<?php#######################################//计数器#######################################function DisplayCounter($File){ $fp=fopen($File,"r"); $num=fread($fp,5); fclose($fp); $fp=fopen($File,"w"); $num+=1; //exec("echo $num >$File"); $b=fwrite($fp,$num); echo "<br>您是第".$num."位无聊人士\n"; fclose($fp);} $CounterFile="counter.txt"; if(!file_exists($CounterFile)){ $fp=fopen($CounterFile,"w"); fwrite($fp,"0"); //exec("echo 0 >$CounterFile"); } DisplayCounter($CounterFile); #######################################?>否则,偶的程序会出现:Warning: Unable to fork [echo 0 >counter.txt] in d:\inet\www\test.php on line 21偶也不知道为什么。就这样。 还是不行呀!不知道有这么多人说PHP的长PHP的短,难道 都是空对空吗??有没有的是干 实例的! <?#读取文件$fp=fopen("counter.txt","r+");$num=fgets($fp,10);rewind($fp);$num++;fputs($fp,$num);if($num<10)$num="00".$num;else $num="0".$num;fclose($fp);#输出图形Header("Content-type:image/gif");//dl("php3_gd.dll");$img=imagecreate(350,30);$bg=ImageColorAllocate($img,0,0,0);$fg=ImageColorAllocate($img,255,255,255);$nu=ImageColorAllocate($img,200,225,255);$mo=ImageColorAllocate($img,255,120,120);ImageString($img,5,5,6,"Welcome,you're the people!",$fg);ImageString($img,5,175,6,$num."th",$nu);ImageArc($img,320,9,20,20,35,190,$mo);ImageGif($img);ImageDestroy($img);?>简单的图形计数器 上面的程序没有判断counter.txt文件不存在的情况。自己加上就可以了! <html><head><title>访客计数器 原型</title></head><body><?php/*simple access counter for php3(c)1998 David W. Bettis[email protected]medify by Wilson Peng*///!!!!!!!!!!!改成一个存在的目录//$counterFile = "/tmp/counter.txt";$counterFile="counter.txt";function displayCounter($counterFile) {if (!file_exists($counterFile)) { $num=1; }else{//!!!!!!!!不要又读又写 $fp = fopen($counterFile,"rw"); $fp=fopen($counterFile, "r"); $num = fgets($fp,5); $num += 1; //将写入分开 fclose($fp);} print "您是第 "."$num"." 位无聊份子";// exec( "rm -rf $counterFile");// exec( "echo $num > $counterFile");//用函数完成写入 $fp=fopen($counterFile, "w"); fputs($fp, "$num"); fclose($fp);}//!!!!!!!移到前面去了 if (!file_exists($counterFile)) {// exec( "echo 0 > $counterFile");}displayCounter($counterFile);?></body></html> preg_match_all正则匹配的取值问题,马上结贴!在线等...... 这个正则怎么写? base64_decode乱码 PHP 输出问题 数据库读出的数据显示问号 wampserver不能配置vhost session问题,从A注册一个session变量,B中得不到值,100分,期待高手!!! 请各位大侠帮我看一下,如何对符合条件的记录做标记 php ip地址 php 支付宝借口问题 怎么为Netscape Entprise Sever安装PHP,谁有经验?清赐教 php难题,请看
唉,我的是PWS+PHP4。0的了
我看是说不清楚了,你们那位也是WINDOWS下的PHP
能不能把你的PHP程序,不管有多简单,有多
请你发我一份好吗??
我真的很想学PHP
可是网上的资料很少,就是有,也是FOR LINUX的,我这单机总不可能格了装LINUX吧
我的E-MAIL是
[email protected]
谢谢了,谢谢
希望你们能帮帮我!
一个PHP的爱好者!
现在用的是nt+iis4.0+php4。
结果也出现先前的计数器程序不能运行。
偶发现php的文件好像只能分别打开读或写,而不能一次打开,同时读写。
偶改了一下程序,铁上来。
<?php
#######################################
//计数器
#######################################
function DisplayCounter($File){
$fp=fopen($File,"r");
$num=fread($fp,5);
fclose($fp);
$fp=fopen($File,"w");
$num+=1;
//exec("echo $num >$File");
$b=fwrite($fp,$num);
echo "<br>您是第".$num."位无聊人士\n";
fclose($fp);
} $CounterFile="counter.txt";
if(!file_exists($CounterFile)){
$fp=fopen($CounterFile,"w");
fwrite($fp,"0");
//exec("echo 0 >$CounterFile");
}
DisplayCounter($CounterFile);
#######################################
?>否则,偶的程序会出现:
Warning: Unable to fork [echo 0 >counter.txt] in d:\inet\www\test.php on line 21偶也不知道为什么。就这样。
都是空对空吗??有没有的是干 实例的!
#读取文件
$fp=fopen("counter.txt","r+");
$num=fgets($fp,10);
rewind($fp);
$num++;
fputs($fp,$num);
if($num<10)$num="00".$num;
else $num="0".$num;
fclose($fp);#输出图形
Header("Content-type:image/gif");
//dl("php3_gd.dll");
$img=imagecreate(350,30);
$bg=ImageColorAllocate($img,0,0,0);
$fg=ImageColorAllocate($img,255,255,255);
$nu=ImageColorAllocate($img,200,225,255);
$mo=ImageColorAllocate($img,255,120,120);
ImageString($img,5,5,6,"Welcome,you're the people!",$fg);
ImageString($img,5,175,6,$num."th",$nu);
ImageArc($img,320,9,20,20,35,190,$mo);
ImageGif($img);
ImageDestroy($img);
?>
简单的图形计数器
<head>
<title>访客计数器 原型</title>
</head>
<body>
<?php
/*
simple access counter for php3
(c)1998 David W. Bettis
[email protected]
medify by Wilson Peng
*///!!!!!!!!!!!改成一个存在的目录
//$counterFile = "/tmp/counter.txt";
$counterFile="counter.txt";function displayCounter($counterFile) {if (!file_exists($counterFile)) {
$num=1;
}
else
{
//!!!!!!!!不要又读又写 $fp = fopen($counterFile,"rw");
$fp=fopen($counterFile, "r");
$num = fgets($fp,5);
$num += 1;
//将写入分开
fclose($fp);
}
print "您是第 "."$num"." 位无聊份子";
// exec( "rm -rf $counterFile");
// exec( "echo $num > $counterFile");
//用函数完成写入
$fp=fopen($counterFile, "w");
fputs($fp, "$num");
fclose($fp);
}//!!!!!!!移到前面去了 if (!file_exists($counterFile)) {
// exec( "echo 0 > $counterFile");
}displayCounter($counterFile);?>
</body>
</html>