-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadduser.php
45 lines (41 loc) · 1.2 KB
/
adduser.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
<?php
/*session_start();
if (!isset($_SESSION["admin"])) {
header('Location: index.php');
exit;
}*/
require_once('mysql_conn.php');
$fname = $_REQUEST['fname'];
$uid = $_REQUEST['uid'];
$email = $_REQUEST['email'];
$dob = $_REQUEST['dob'];
$gender = $_REQUEST['gender'];
$role = $_REQUEST['role'];
$edu = $_REQUEST['edu'];
$phone = $_REQUEST['phone'];
$address = $_REQUEST['address'];
$password = $_REQUEST['pass'];
$msg="";
$sql1 ="INSERT INTO `users` (user_id, pass, role)
VALUES ('$uid', '$password', '$role')";
if(!mysql_query($sql1))
{
echo "Error in users: " . $sql1. "<br>" . mysql_error($conn);
}
$sql = "INSERT INTO `user_info`(`user_id`, `full_name`, `email`, `edu`, `dob`, `gender`, `phone`, `address`,`active`) VALUES ('$uid','$fname','$email','$edu','$dob','$gender','$phone','$address',0)";
if(!mysql_query($sql))
{
echo "Error in user_info: " . $sql . "<br>" . mysql_error($conn);
}
else
$msg= 'User Successfully Inserted';
?>
<html>
<head><title>User Confirmation || Online Quiz Test</title></head>
<center>
<h1>User Confirmation || Online Quiz Test</h1>
<hr>
<p style="color:green"><?php echo $msg; ?></p>
<a href="index.php">Go To Home Page</a>
</center>
</html>