-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsreg.php
44 lines (28 loc) · 874 Bytes
/
sreg.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"];
$conn = mysqli_connect("localhost:3308","root","","project3-2");
$que = "select * from studentreg where email = '$username'";
$ans = mysqli_query($conn,$que);
$rows = mysqli_num_rows($ans);
if($rows != 0)
{
$message = "Username already exists";
echo "<script type='text/javascript'>alert('$message');</script>";
}
else
{
$sql = "insert into studentreg (FName,LName,email,password) values ('$fname','$lname','$username','$password')";
$res = mysqli_query($conn,$sql);
echo("<br> Account created successfully <br>");
header("location:slogin.html");
}
$conn->close();
?>
</body>
</html>