-
Notifications
You must be signed in to change notification settings - Fork 2
/
startup_login.php
62 lines (55 loc) · 2.05 KB
/
startup_login.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
<?php
ob_start();
session_start();
?>
<?php include('includes/db.php') ?>
<?php include('includes/header.php') ?>
<!-- BLUE WRAP-->
<!-- ***************************************************************************************************************** -->
<div id="blue">
<div class="container">
<div class="row">
<h3>Startup Login</h3>
</div>
<!-- /row -->
</div>
<!-- /container -->
</div>
<!-- /blue -->
<!-- *****************************************************************************************************************
TITLE & CONTENT
***************************************************************************************************************** -->
<div class="container mtb">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 centered">
<form action="" class="form" method="post">
<div class="form-group">
<input type="text" class="form-control" placeholder="Username" name = "username">
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" name = "password">
</div>
<div class="form-group">
<input type="submit" value="Login" name = "submit">
</div>
</form>
</div>
</div>
</div>
<?php
if(isset($_POST['submit'])){
$username = mysqli_real_escape_string($conn,$_POST['username']);
$password = mysqli_real_escape_string($conn,$_POST['password']);
$query = "SELECT * FROM startups_accounts WHERE username = '$username' and password='$password'";
$res = mysqli_query($conn,$query);
if(mysqli_num_rows($res)!=0){
while($r = mysqli_fetch_assoc($res)){
$_SESSION['username']=$r['username'];
$_SESSION['startup_id']=$r['startup_id'];
$_SESSION['role']=$r['role'];
header('Location: Startup_profile.php');
}
}
}
?>
<?php include('includes/footer.php') ?>