-
Notifications
You must be signed in to change notification settings - Fork 0
/
action1.php
49 lines (43 loc) · 1.61 KB
/
action1.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
<?php
require 'connect.php';
if((isset($_POST['username'])&&isset($_POST['password']))&& !empty($_POST['username'])&&!empty($_POST['password']))
{
$user=$_POST['username'];
$pass=$_POST['password'];
$query="insert into admin(username,password) values('".$user."','".$pass."')";
if($run = mysqli_query($con,$query))
{
?>
<html>
<table>
<tr>
<th>username</th>
<th>password</th>
</tr>
<?php
$query2= "select * from admin";
$run2 = mysqli_query($con,$query2);
$num = mysqli_num_rows($run2);
for($i=1;$i<=$num;$i++)
{
$row=mysqli_fetch_assoc($run2);
?>
<tr>
<td>
<?php echo $row['username'];?>
</td>
<td>
<?php echo $row['password'];?>
</td>
</tr>
<?php
}
?>
</table>
</html>
<?php
}
}
else
echo'failed';
?>