-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminhome.php
executable file
·66 lines (54 loc) · 2.49 KB
/
adminhome.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
<?php
session_start();
include_once 'db.php';
include 'adminheader.php';
if(isset($_POST['add_agent']))
{
print_r($_POST);
$uname = mysqli_real_escape_string($conn,$_POST['username']);
$agname=mysqli_real_escape_string($conn,$_POST['agname']);
$upass = mysqli_real_escape_string($conn,$_POST['password']);
$email = mysqli_real_escape_string($conn,$_POST['email']);
$phone=mysqli_real_escape_string($conn,$_POST['phone']);
$place=mysqli_real_escape_string($conn,$_POST['place']);
if(mysqli_query($conn,"INSERT INTO add_agent(uname,agname,password,agemail,agphone,agplace) VALUES('$uname','$agname','$upass','$email','$phone','$place')"))
{
?>
<script>alert('successfully registered ');</script>
<?php
header("location:adminhome.php");
}
else
{
?>
<script>alert('error while registering you...');</script>
<?php
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head >
<body id="back" style="width: 100%; height:100%; padding-bottom:20px" >
</body>
</html>
<body id="back" style="width: 100%; height:100%; padding-bottom:20px" >
<div style="padding-left: 200px;">
<div id="adivhead">Add Agent Details</div>
<form method="POST">
<div id="agent">
<label>Username </label><input type="text" name="username"><br><br>
<label>Agent Name </label><input type="text" name="agname"><br><br>
<label>Password </label><input type="password" name="password"><br><br>
<label>Email </label><input type="email" name="email"><br><br>
<label>Phone </label><input type="text" name="phone"><br><br>
<label>Working Place </label><input type="text" name="place"><br><br></div>
<div id="agentadd"><input type="submit" name="add_agent" Value="Add Agent"></div>
</form></div>
</body>
</html>