-
Notifications
You must be signed in to change notification settings - Fork 2
/
log_entry.php
58 lines (58 loc) · 1.62 KB
/
log_entry.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
<?php
$user="sickwiz";
$l="localhost";
$p="2409";
$d="SHARECARE";
$con= mysqli_connect($l,$user,$p,$d);
if($con)
{
if(isset($_POST["submit"]))
{
$en=$_POST['enrollment'];
$pass=$_POST['password'];
$pass2=password_hash($pass,PASSWORD_ARGON2I);
$sq="SELECT NAME FROM INFO WHERE ENROLLMENT='$en'";
$res=mysqli_query($con,$sq);
/* if($res)
echo "hello <br>";*/
if(mysqli_num_rows($res)>0)
{
echo "ACCOUNT ALREADY EXISTS WITH THE FOLLOWING ENROLLMENT NUMBER <br>";
mysqli_close($con);
}
else
{
$sec=$_POST['security'];
$sec_ps=($_POST['secpas']);
$sec_ps1=password_hash($sec_ps,PASSWORD_ARGON2I);
$in_login="INSERT INTO LOGIN VALUES('$en','$sec','$pass2','$sec_ps1')";
if(mysqli_query($con,$in_login))
echo "1 <br>";
else
echo "2";
$n=$_POST['name'];
$e=$_POST['email'];
$d=$_POST['dob'];
$h=$_POST['home'];
$col=$_POST['college'];
$branch=$_POST['dept'];
$sem=$_POST['sem'];
$gen=$_POST['sex'];
$mobi=$_POST['mobile'];
$in_info="INSERT INTO INFO VALUES('$n','$e','$gen','$d','$col','$branch','$sem','$h','$en',$mobi)";
if(mysqli_query($con,$in_info))
{
header("location:login.php");
}
else
{
echo "failed" .mysqli_error();
}
}
}
}
else
{
die("connection failed") .mysqli_connect_error;
}
?>