-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdate-profile.php
34 lines (29 loc) · 1.13 KB
/
update-profile.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
<?php
include 'config.php';
session_start();
if (empty($_SESSION['login_user'])){
header("location: index.php");
exit();
}
$user = $_SESSION['login_user'];
if (($_GET['institute'] != "select-inst") && ($_GET['degree'] != "select-deg") && ($_GET['from_year'] != "year") && ($_GET['to_year'] != "year")){
$inst = $_GET['institute'];
$deg = $_GET['degree'];
$from = $_GET['from_year'];
$to = $_GET['to_year'];
$query = "INSERT INTO has_degree(student_id, degree_id, verified, from_year, to_year, institute_id) VALUES ($user,$deg,0,$from,$to,$inst)";
$table = mysqli_query($connection,$query);
}
if (!empty($_GET['skill'])){
$skill = $_GET['skill'];
$query = "INSERT INTO has_skill(student_id, skill) VALUES ('$user','$skill')";
$table = mysqli_query($connection,$query);
}
if(!empty($_GET['interest'])){
$interest = $_GET['interest'];
$query = "INSERT INTO has_interest(student_id, interest) VALUES ('$user','$interest')";
$table = mysqli_query($connection,$query);
}
header("location: profile.php?user=".$_SESSION['login_user']);
mysqli_close($connection); // Closing Connection
?>