Added lot of junk laying around on harvie.cz
[mirrors/Programs.git] / php / skripty / multi_terminal.php
1 <?php
2
3 $i = 0;
4 $pfp[$i] = popen ("cmd.exe", "rw");
5 $ifp = fopen ("php://stdin", "r");
6
7 /*
8 a = 1
9 y = 25
10 */
11
12 /*while(1) {
13 echo( ord(fgetc($ifp))."-\n" );
14 }*/
15
16 while($pfp[$i]) {
17 echo (fgetc($pfp[$i]));
18 if (feof($ifp)) {
19 $c = fgetc($ifp);
20 if (ereg(chr(1), $c)) { $i++; $pfp[$i] = popen ("cmd.exe", "rw"); echo("\nconsole: $i\n"); }
21 if (ereg(chr(25), $c)) { $i--; echo("\nconsole: $i\n"); }
22 fwrite ($pfp[$i], $c);
23 }
24 }
25
26 ?>
This page took 0.411272 seconds and 4 git commands to generate.