-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreg.php
More file actions
110 lines (73 loc) · 2.24 KB
/
reg.php
File metadata and controls
110 lines (73 loc) · 2.24 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<form method ="post" >
<input type="text" name="name" placeholder="username"><br><br>
<input type="password" name="password" placeholder="password"><br><br>
<input type="email" name="email" placeholder="email"><br><br>
<input type="submit" name="submit">
</form>
<?php
include 'conn.php';
if(isset ($_POST["submit"]))
{
$name = $_POST["name"];
$password = $_POST["password"];
$email=$_POST["email"];
$sql = "SELECT * FROM `users` WHERE email='$email' ";
$sql_run = mysqli_query($conn, $sql);
if($sql_run){
$sql_row = mysqli_num_rows($sql_run);
if($sql_row>0)
{
echo "email alreay exits";
}else{
$insert = "INSERT INTO `users` (`username`, `password`, `email`) VALUES ('$name','$password','$email')";
$sql_insert = mysqli_query($conn, $insert);
if($sql_insert){
echo"succ";
}
else{
echo "succ not";
}
}
}
}
?>
<!-- <table border =1 style="margin-top:10px;">
<tr>
<th>Id</th>
<th>user</th>
<th>Phone</th>
<th>email</th>
<th>Action</th>
<th> update </th>
</tr>
<?php
$sql = "SELECT * FROM `users`";
$sql_run = mysqli_query($conn, $sql);
$row = mysqli_num_rows($sql_run);
if ($row>0){
while($f = mysqli_fetch_array($sql_run)){
?>
<tr>
<td><?php echo $f['id'];?></td>
<td><?php echo $f['username'];?></td>
<td><?php echo $f['password'];?></td>
<td><?php echo $f['email'];?></td>
<td><a href="delete.php?ids=<?php echo $f['id'];?>">delete</td>
<td><a href="up.php?ids=<?php echo $f['id'];?>">update</td>
</tr>
<?php
}
}else{
echo "no data";
}
?> -->
</body>
</html>