-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.php
More file actions
85 lines (73 loc) · 2.55 KB
/
profile.php
File metadata and controls
85 lines (73 loc) · 2.55 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
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
<?php
// include_once("profile.html");
require_once("Dao.php");
session_start();
if ((isset($_SESSION["loggedin"]) && !$_SESSION["loggedin"] )||
!isset($_SESSION["loggedin"])) {
header("Location:login.php");
exit;
}
$dao = new Dao();
if(isset($_SESSION['email'])){
$email = $_SESSION['email'];
$user = $dao->userinfo($email);
if($user){
$_SESSION['username'] = $user['username'];
}else
echo "no info";
}
?>
<html>
<head>
<title>Log In Page</title>
<link rel="stylesheet" href="login.css">
<link rel="icon" type="favicon.jpg" href="image/shipicon.jpg">
</head>
<div class="header">
<header>
<a href="index.html"><img class= "icon" src="image/shipicon.jpg" width=40px height=40px></a>
<a href="index.html"><h1 class="header">Language Partnership</h1></a>
</header>
<div>
<ul class="nav">
<li><a href="learner_account_create.html">Join as mentee</a></li>
<li><a href="speaker_account_create.html">Join as mentor</a></li>
<li class="currentlink"> <a href="profile.php"> LoggedIn</a></li>
<li><a href="index.html"> Homepage</a></li>
</ul>
</div>
</div>
<h1>Welcome to Language Partnership</h1>
<h2 class= "titleline">Thanks for joining us dear <h2>
<?php if(isset($_SESSION['username'])){?>
<h2 class="titleline"><?= $_SESSION['username'] ?></h2>
<?php }?>
<h2>Tell us more about you and what you are looking for :) </h2>
<?php if(isset($_SESSION['errormsg'])){?>
<span class="errormsg" ><?= $_SESSION['errormsg'] ?></span>
<?php } ?>
<br><br>
<form method="POST" action="profile_handler.php">
<div class="form-group">
<label for="sel1">First Language(select one):</label><br>
<select class="dropdown" id="sel1" name="firstlanguage">
<option value="Chinese">Chinese</option>
<option value="English">English</option>
<option value="Spanish">Spanish</option>
<option value="Japanese">Japanese</option>
<option value="Korean">Korean</option>
</select>
<br>
<label for="sel1">Learning Language (select one):</label>
<select class="dropdown" id="sel2" name="learninglanguage">
<option value="Chinese">Chinese</option>
<option value="English">English</option>
<option value="Spanish">Spanish</option>
<option value="Japanese">Japanese</option>
<option value="Korean">Korean</option>
</select>
</div>
<input type="submit" class="button" value="Try your luck">
</form>
<a href="logout.php"><h3 class="logout">Try it later. Logout</h3></a>
</html>