-
Notifications
You must be signed in to change notification settings - Fork 3
/
add_agent.php
executable file
·54 lines (51 loc) · 1.84 KB
/
add_agent.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
<?php
session_start();
include_once 'db.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:add_agent.php");
}
else
{
?>
<script>alert('error while registering you...');</script>
<?php
}
}
?>
<html>
<head>
<link href="style.css" rel="stylesheet">
</head>
<body>
<div id="head">
</div>
<div id="menu">
<a href="add_agent.php">Add Agent</a>
<a href="view_amessage.php">View agent Message</a>
<a href="view_drequest.php">View Donator request</a>
<a href="view_feedback.php">View Feedback</a>
</div>
<form method="POST">
<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 id="regdiv"><input type="submit" name="add_agent" Value="ADD"></div>
</form>
</body>
</html>