-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistration.php
More file actions
84 lines (58 loc) · 1.6 KB
/
registration.php
File metadata and controls
84 lines (58 loc) · 1.6 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
<!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>
<input type="text" name="name"><br>
<input type="number" name="phone"><br>
<input type="submit" name="submit">
</form>
<?php
include 'connection.php';
if(isset ($_GET["submit"]))
{
$name = $_GET["name"];
$phone = $_GET["phone"];
$insert = "INSERT INTO `name`(`name`, `phone`, `address`) VALUES ('$name', '$phone', 'sdfasdf')";
$insert_run = mysqli_query($conn, $insert);
if($insert_run){
echo"succ";
}else{
echo "succ not";
}
}
?>
<table border=1 style="margin-top:10px;">
<tr>
<th>Id</th>
<th>user</th>
<th>Phone</th>
<th>Action</th>
</tr>
<?php
$sql = "SELECT * FROM `name`";
$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['name'];?></td>
<td><?php echo $f['phone'];?></td>
<td><a href="del.php?ids=<?php echo $f['id'];?>">delete</td>
<td><a href="update.php?ids=<?php echo $f['id'];?>">update</td>
</tr>
<?php
}
}else{
echo "no data";
}
?>
</body>
</html>
?>