-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.php
65 lines (46 loc) · 1.43 KB
/
register.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
<?php
require("connection.php");
if($_POST)
{
$computer_code = $_POST['computer_code'];
$dob = $_POST['date_of_birth'];
$password1 = $_POST["password1"];
$password2 = $_POST["password2"];
$email = $_POST["email"];
$phone_number = $_POST["phone_number"];
$password_hash = md5($_POST["password1"]);
if(!empty($password1) && !empty($password2) && !empty($email) && !empty($phone_number) && !empty($computer_code) && !empty($dob))
{
$query1="select * from student_info where Computer_Code='".$computer_code."'";
$result=$con->query($query1);
$row=$result->fetch_assoc();
if ($row["Password"] == null)
{
if($computer_code == $row["Computer_Code"] && $dob == $row["DOB"])
{
if ($password1 == $password2)
{
$query="UPDATE student_info SET phone_no = '$phone_number',Password = '$password1', Email = '$email' WHERE Computer_Code = '".$computer_code."' " ;
$result=$con->query($query);
if (!$result) {
echo "error hua hai!";
echo mysqli_error($con);
}
else{
header("Location: index.php");
}
}
else{
echo "Password do not match";
}
}else{
echo "Invalid Computer Code or DOB";
}
}else{
echo "You are already Awesome";
}
}else{
echo "All fields required";
}
}
?>