一个php数据流应用的小例子
时间:2021-07-01 10:21:17
帮助过:30人阅读
- /**
- php数据流应用
- date:2013/2/19
- */
- $count = 5;
- start:
- if($count < 5) echo "You can try {$count} time, ";
- echo "Put Password: ";
- $handle = fopen ("php://stdin","r");
- $line = fgets($handle);
- if(trim($line) != '123456'){
- $count--;
- if(!$count) goto error;
- goto start;
- }
- goto success;
- error:
- echo "Please try after 1 hour! http://bbs.it-home.org";
- goto out;
- success:
- echo "Logined!";
- out:
- ?>
效果图如下所示:
|