forked from Bishnupkl/Online-Entrance-Examination
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstu_reg_process.php
More file actions
executable file
·81 lines (51 loc) · 1.83 KB
/
Copy pathstu_reg_process.php
File metadata and controls
executable file
·81 lines (51 loc) · 1.83 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
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="dist/sweetalert.min.js"></script>
<title></title>
</head>
<body>
</body>
</html>
<?php
$name = $_POST["name"];
$address = $_POST["address"];
$fatname = $_POST["fatname"];
$dob = $_POST["dob"];
$phone = $_POST["phone"];
// print_r($phone);
$email = $_POST["email"];
$password = $_POST["password"];
//salting technique
$salt = "djf*iwir£jg".rand(10000,99999)."kjg@g!jkg&gj";
$salted_password = sha1($salt.$password);
$gender = $_POST["gender"];
$datesasa=date("Y-m-d");
$con = mysqli_connect("localhost","20nu","20nu","oee");
if (!$con) {
die("connection could not be established".mysqli_error());
}
// inserting data into database oee
// $sql_query = "INSERT INTO stu_reg(name,address,fatname,dob,phone,email,password,reg_date,gender,exam_status,salting_value) values($name,$address,$fatname,$dob,$phone,$email,$password,$datesasa,$gender,'not taken',$salt)";
$sql_query = "INSERT INTO stu_reg(name,address,fatname,dob,phone,email,password,reg_date,gender,exam_status,salting_value) values('$name','$address','$fatname','$dob','$phone','$email','$password','$datesasa','$gender','not taken','$salt')";
$result = mysqli_query($con,$sql_query);
if (!$result) {
echo "<script>swal('This email is already registered !!!', '', 'warning')
.then((value) => {
window.location='index.php';
});
</script>";
}
else{
// $result_student="INSERT INTO result(email,ques_attempted,mark_obtained,right_answer,wrong_answer) values('$email','0','0','0','0')";
// $result = mysqli_query($con,$result_student);
// print_r($result);
session_start();
$_SESSION["ema"]=$email;
echo "<script>swal('You are registered !!!', '', 'success')
.then((value) => {
window.location='index.php';
});
</script>";
}
?>