-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
57 lines (38 loc) · 1.05 KB
/
index.php
File metadata and controls
57 lines (38 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
</body>
</html>
<?php
$number = $_POST['number_entered'];
$submitButton = $_POST['submit'];
$randomNumber = rand(1, 10);
?>
<form class="all" action="" method="POST" >
<p class="the_text" >Guess the number beween 1 and 10, or you die </p>
<input type="text" name="number_entered">
<p class="the_text" >I'm not playing games, i've got your wife.<br> </p>
<br>
<?php
if($submitButton){
if(($number > 0) && ($number < 11)) {
if($number!=$randomNumber){
echo " <p style='color:red;'> You've done goofed, because number was $randomNumber ";
}
else
{
echo "<p style='color:red;'> You live to die another day </p>";
}
}
}
?>
<br>
<input type="submit" name="submit" value="Guess">
</form>