-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
74 lines (64 loc) · 2 KB
/
index.php
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
session_start();
if (!isset($_SESSION['username'])) {
$_SESSION['msg'] = "You must log in first";
header('location: login.php');
}
if (isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header("location: login.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Home Page</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<script src="main.js">
</script>
<div class="header">
<h2>Home Page</h2>
</div>
<div class="content">
<!-- notification message -->
<?php if (isset($_SESSION['success'])) : ?>
<div class="error success" >
<h3>
<?php
echo $_SESSION['success'];
unset($_SESSION['success']);
?>
</h3>
</div>
<?php endif ?>
<!-- logged in user information -->
<?php if (isset($_SESSION['username'])) : ?>
<p>Hello <strong><?php echo $_SESSION['username']; ?></strong> Welcome Back ;)</p>
<?php endif ?>
<div class="input-group">
Find odd or Even:<input id="age" placeholder="Enter Number"><br />
</div>
<button onclick="odd_even()" class="btn" >Click me for Result</button>
<div class="input-group">
Know You are Allowed to Vote or not:<input id="vote" placeholder="Enter your age"><br />
</div>
<button onclick="vote()" class="btn" >Check voting age</button>
<div class="input-group">
Check number is Palindrome or Not:<input id="no_input" placeholder="Enter number"><br />
</div>
<button onclick="palin()" class="btn" >Check Palindrome</button>
<div class="input-group">
Get numbers on Reverse : <input id="rever" placeholder="Enter numbers"><br />
</div>
<button onclick="rev()" class="btn" >Reverse Number</button>
<div class="input-group">
Which Multiplicatin Table you Want? <input id="tab" placeholder="Enter number"><br />
</div>
<button onclick="table()" class="btn" >Get Table</button>
<p> <a href="index.php?logout='1'" style="color: green;">logout</a> </p>
</div>
</body>
</html>