-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
91 lines (85 loc) · 4.18 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php?>
<html>
<head>
<!--Import Font Awesome-->
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="css/materialize.css" media="screen,projection"/>
<!--Import My styles.css-->
<link type="text/css" rel="stylesheet" href="css/styles.css"/>
<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="js/jquery-2.2.0.js"></script>
<!--Import materialize.js-->
<script type="text/javascript" src="js/materialize.js"></script>
<!--Let browser know website is optimized for mobile-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<!--Setup page title and icon-->
<link href="img/uos_icon.png" type="image/png" rel="shortcut icon" />
<title>UOS UDC</title>
</head>
<body>
<!--Page header start-->
<div class="header deep-purple lighten-2">
<div class="container">
<!--Main row in the header-->
<div class="row">
<!--Column containing UOS logo-->
<div class="col s12 m4">
<a id="logo-container" herf="http://www.sharjah.ac.ae/" class="brand-logo">
<object type="image/svg+xml" data="img/uos_logo.svg"></object>
</a>
</div>
</div>
<!--Just for a bit of space-->
<div class="row"></div>
</div>
</div><!--Page header end-->
<!--Welcome login form section-->
<div class="container">
<div class="row">
<div class="col m6 s12">
<!--Login card start-->
<div class="card">
<div class="card-content">
<div class="row" id="login-card">
<!--Login form start-->
<form class="col s12" action="" method="post">
<div class="row">
<h5 class="col s12">Sign in</h5>
</div>
<div class="row">
<div class="input-field col s12">
<input id="sid" name="sid" type="text" class="validate">
<label for="sid">Username</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input id="pin" name="pin" type="password" class="validate">
<label for="pin">Password</label>
</div>
</div>
<div class="row">
<div class="col s12">
<button type="submit" name="login" value="done" class="waves-effect waves-light btn-large green col s12">login</button>
</div>
</div>
</form><!--Login form end-->
<!--Php login code-->
<?php
if(isset($_POST["login"])) {
$cookie = fopen("cookie.txt", "w");
fwrite($cookie, $_POST["sid"].PHP_EOL.$_POST["pin"]);
fclose($cookie);
$page = exec("python login.py");
echo $page;
}
?>
</div>
</div>
</div><!--Login card end-->
</div>
</div>
</div>
</body>
</html>