-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate.php
More file actions
47 lines (38 loc) · 1.07 KB
/
Copy pathcreate.php
File metadata and controls
47 lines (38 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
<?php
session_start();
include 'db_conn.php';
if(isset($_POST['submit']))
{ $username = $_POST['username'];
$FirstName = $_POST['FirstName'];
$LastName = $_POST['LastName'];
$email = $_POST['Email'];
$role = $_POST['role'];
$password = $_POST['password'];
$password = md5($password);
$sql = "INSERT INTO users (username, FirstName, LastName, Email, password, role )
VALUES ('$username','$FirstName', '$LastName', '$email', '$password', '$role')";
if (mysqli_query($conn, $sql)) {
header('location: memberlist.php');
echo "inserted ";
} else {
echo "Error: " . $sql . mysqli_error($conn);
}
$conn->close();
}
if (isset($_SESSION['username']) && isset($_SESSION['id'])) {
?>
<!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>Sophia | Add Members</title>
</head>
<body>
<div id="myModal" class="modal">
</body>
</html>
<?php }else{
header("Location: index.php");
} ?>