-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsignup.php
77 lines (56 loc) · 1.65 KB
/
signup.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
66
67
68
69
70
71
72
73
74
75
76
77
<!Doctype html>
<html>
<head>
<style >
body{
text-align: center;
color: black;
background-image: url("qq.jpg");
background-size : cover;
}
</style>
</head>
<body>
<?php
$conn = new mysqli("localhost", "root", "Hello@123", "se");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$name=mysqli_real_escape_string($conn, $_POST['name']);
$address=mysqli_real_escape_string($conn, $_POST['address']);
$mobileno=mysqli_real_escape_string($conn, $_POST['mobileno']);
$email=mysqli_real_escape_string($conn, $_POST['email']);
$address=mysqli_real_escape_string($conn, $_POST['address']);
$department=mysqli_real_escape_string($conn, $_POST['department']);
$rollno=mysqli_real_escape_string($conn, $_POST['rollno']);
$password=mysqli_real_escape_string($conn, $_POST['password']);
$role="user";
$sql = " INSERT INTO login(name,address,mobileno,email,department,rollno) VALUES ('$name','$address','$mobileno','$email','$department','$rollno')";
$sql1 = " INSERT INTO password(email,password,role) VALUES ('$email','$password','$role')";
if (mysqli_query($conn, $sql) === TRUE) {
echo "new account created successfully";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
if (mysqli_query($conn, $sql1) === TRUE) {
echo "Account Created!";
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>
<br><br>
<br>
<footer style=" clear: both;
position: relative;
z-index: 10;
height: 3em;
margin-top: -3em;background-color: #333;">
<center>
<?php
echo $_SESSION['username'];
?>
</center>
</footer>
</body>
<html>