-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddingagent.php
More file actions
49 lines (49 loc) · 1.07 KB
/
Copy pathaddingagent.php
File metadata and controls
49 lines (49 loc) · 1.07 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
<?php
session_start();
$agent_id=$_POST['agent_id'];
$pass=$_POST['pass'];
$name=$_POST['name'];
$email=$_POST['email'];
$mobile=$_POST['mobile'];
$address=$_POST['address'];
// echo $mobile;
$user="root";
$password="123"; password
$db=""; // database name
$conn=mysqli_connect('localhost',$user,$password,$db);
$sql="select password from account where user_id=$agent_id";
$result=mysqli_query($conn,$sql);
$result=mysqli_num_rows($result);
if($result)
{
echo "choose different user ID";
?>
<?php
}
if($result==NULL)
{
$sql="Insert into agent values('$agent_id','$name','$email','$mobile','$address','0');";
$result=mysqli_query($conn,$sql);
if($result)
{
// echo "data inserted";
}
else
{
echo "Some error try to again Signup";
}
$sql="Insert into account values('$agent_id','$pass','0')";
$result=mysqli_query($conn,$sql);
if($result)
{
echo "You are successfully register login now";
?>
<?php
}
else
{
echo "Some error try to again add agent";
}
}
session_unset();
?>