-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecreg.php
44 lines (27 loc) · 911 Bytes
/
recreg.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
<!DOCTYPE html>
<html>
<body>
<?php
$fname = $_POST["FName"];
$lname = $_POST["LName"];
$username = $_POST["regemail"];
$password = $_POST["regpass"];
$company = $_POST["company"];
$conn = mysqli_connect("localhost:3308","root","","project3-2");
$que = "select * from recruitreg where Email = '$username' or Company = '$company'";
$ans = mysqli_query($conn,$que);
$rows = mysqli_num_rows($ans);
if($rows != 0)
{
$message = "Username or Company name already exists";
echo "<script type='text/javascript'>alert('$message');</script>";
}
else
{
$sql = "insert into recruitreg (FName,LName,Company,Email,Password) values ('$fname','$lname','$company','$username','$password')"; $res = mysqli_query($conn,$sql);
header("location:main.html");
}
$conn->close();
?>
</body>
</html>