Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <HTML>
- <HEAD>
- <META charset="utf-8">
- <TITLE> TABLE FORM </TITLE>
- <style>
- body {
- text-align:center;
- background-color:orange;
- }
- fieldset{
- width:100px;
- }
- form {
- margin:auto;
- width:100px;
- }
- img {
- width:400px;
- height:200px;
- }
- </style>
- </HEAD>
- <BODY>
- <h2> ΠΑΙΞΕ ΤΖΟΚΕΡ ΤΩΡΑ online </h2>
- <img src="tzoker.jpg"/>
- <form action="result.php" method="POST">
- <fieldset>
- <legend> Διάλεξε 5 αριθμούς από το 1-45 </legend>
- <input type="number" min="1" max="45" name="num1" required/>
- <input type="number" min="1" max="45" name="num2" required/>
- <input type="number" min="1" max="45" name="num3" required/>
- <input type="number" min="1" max="45" name="num4" required/>
- <input type="number" min="1" max="45" name="num5" required/>
- </fieldset>
- <fieldset>
- <legend> Διάλεξε 1 αριθμό Τζοκερ από το 1-20 </legend>
- <input type="number" min="1" max="20" name="tzoker" required/>
- </fieldset>
- <input type="submit" value="PLAY"/>
- </form>
- </BODY>
- </HTML>
- <?php
- $pinakas = array($_POST["num1"],$_POST["num2"],$_POST["num3"],$_POST["num4"],$_POST["num5"]);
- $tzoker = $_POST["tzoker"];
- sort($pinakas);
- if( count(array_unique($pinakas)) < count($pinakas) ) {
- echo "Διάλεξες ίδια νούμερα <a href='18_11.php'> ΠΑΙΞΕ ΞΑΝΑ </a>";
- }
- else {
- echo "<table border='1'>
- <tr><th colspan='5'>Οι αριθμοί που έπαιξες είναι:</th>
- <th> Ο τζοκερ ειναι</th></tr><tr>";
- for ($i=0;$i<5;$i++){
- echo "<td>".$pinakas[$i]."</td>";
- }
- echo "<td style='background-color:grey'>".$tzoker."</td>";
- echo "</tr></table>";
- }
- $tzoker2 = rand(1,20);
- $pinakas2 = array(rand(1,45),rand(1,45),rand(1,45),rand(1,45),rand(1,45));
- while( count(array_unique($pinakas2)) < count($pinakas2) ){
- $pinakas2 = array(rand(1,45),rand(1,45),rand(1,45),rand(1,45),rand(1,45));
- }
- sort($pinakas2);
- echo "<table border='1'>
- <tr><th colspan='5'>Οι αριθμοί που κληρώθηκαν:</th>
- <th> Ο τζοκερ ειναι</th></tr><tr>";
- for ($i=0;$i<5;$i++){
- echo "<td>".$pinakas2[$i]."</td>";
- }
- echo "<td style='background-color:grey'>".$tzoker2."</td>";
- echo "</tr></table>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement