-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpgedu.php
107 lines (67 loc) · 2.3 KB
/
pgedu.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html>
<body>
<?php
session_start();
$user = $_SESSION["user"];
$pginst = $_POST["pinst"];
$pgyear = $_POST["ppass"];
$pgperc = $_POST["pperc"];
$ginst = $_POST["ginst"];
$gyear = $_POST["gpass"];
$gperc = $_POST["gperc"];
$intinst = $_POST["iinst"];
$intyear = $_POST["ipass"];
$intperc = $_POST["iperc"];
$sclinst = $_POST["sinst"];
$sclyear = $_POST["spass"];
$sclperc = $_POST["sperc"];
$conn = mysqli_connect("localhost:3308","root","","project3-2");
$check="select user from pg_details where user='$user'";
$checkans=mysqli_query($conn,$check);
$chck=mysqli_fetch_array($checkans);
if(is_null($chck[0]))
{
$que1 = "insert into pg_details values ('$user','$pginst','$pgyear','$pgperc')";
$que2 = "insert into grad_details values ('$user','$ginst','$gyear','$gperc')";
$que3 = "insert into inter_details values ('$user','$intinst','$intyear','$intperc')";
$que4 = "insert into school_details values ('$user','$sclinst','$sclyear','$sclperc')";
$ans1 = mysqli_query($conn,$que1);
$ans2 = mysqli_query($conn,$que2);
$ans3 = mysqli_query($conn,$que3);
$ans4 = mysqli_query($conn,$que4);
$rows = mysqli_num_rows($ans4);
if($rows == 0)
{
header("location:tech.html");
}
else
{
$message = $rows;
echo "<script type='text/javascript'>alert('$message');</script>";
}
}
else{
$que5 = "update pg_details set instiutute='$pginst',year='$pgyear',percentage='$pgperc'where user='$user'";
$que6 = "update grad_details set institute='$ginst',year='$gyear',percentage='$gperc'where user='$user'";
$que7 = "update inter_details set institute='$intinst',year='$intyear',percentage='$intperc'where user='$user'";
$que8 = "update school_details set institute='$sclinst',year='$sclyear',percentage='$sclperc'where user='$user'";
$ans5 = mysqli_query($conn,$que5);
$ans6 = mysqli_query($conn,$que6);
$ans7 = mysqli_query($conn,$que7);
$ans8 = mysqli_query($conn,$que8);
$rows = mysqli_num_rows($ans8);
if($rows == 0)
{
header("location:tech.html");
}
else
{
$message = $rows;
echo "<script type='text/javascript'>alert('$message');</script>";
}
}
$conn->close();
?>
</body>
</html>