-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateuser.php
More file actions
92 lines (86 loc) · 4.28 KB
/
createuser.php
File metadata and controls
92 lines (86 loc) · 4.28 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/createuser.css">
<title>Create User</title>
</head>
<body>
<?php
include 'config.php';
if(isset($_POST['submit'])){
$name=$_POST['name'];
$email=$_POST['email'];
$balance=$_POST['balance'];
$sql="insert into users(name,email,balance) values('{$name}','{$email}','{$balance}')";
$result=mysqli_query($conn,$sql);
if($result){
echo "<script> alert('Hurray! User created');
window.location='transfermoney.php';
</script>";
}
}
?>
<header class="text-gray-600 body-font">
<div class="container mx-auto flex flex-wrap p-5 flex-col md:flex-row items-center">
<a class="flex title-font font-medium items-center text-gray-900 mb-4 md:mb-0">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-10 h-10 text-white p-2 bg-indigo-500 rounded-full" viewBox="0 0 24 24">
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path>
</svg>
<span class="ml-3 text-xl">Banking System</span>
</a>
<nav class="md:mr-auto md:ml-4 md:py-1 md:pl-4 md:border-l md:border-gray-400 flex flex-wrap items-center text-base justify-center">
<a href="index.html" class="mr-5 hover:text-gray-900">Home</a>
<a href="createuser.php" class="mr-5 hover:text-gray-900">Create User</a>
<a href="transfermoney.php" class="mr-5 hover:text-gray-900">Transfer Money</a>
<a href="transactionhistory.php" class="mr-5 hover:text-gray-900">Transfer History</a>
<a class="mr-5 hover:text-gray-900">Contact</a>
</nav>
<button class="inline-flex items-center bg-gray-100 border-0 py-1 px-3 focus:outline-none hover:bg-gray-200 rounded text-base mt-4 md:mt-0">Learn More
<svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-4 h-4 ml-1" viewBox="0 0 24 24">
<path d="M5 12h14M12 5l7 7-7 7"></path>
</svg>
</button>
</div>
</header>
<h2 class="text-center pt-4" style="color : black;">Create a User</h2>
<br>
<div class="background">
<div class="container">
<div class="screen">
<div class="screen-header">
<div class="screen-header-right">
<div class="screen-header-ellipsis"></div>
<div class="screen-header-ellipsis"></div>
<div class="screen-header-ellipsis"></div>
</div>
</div>
<div class="screen-body">
<div class="screen-body-item">
<form class="app-form" method="post">
<div class="app-form-group">
<input class="app-form-control" placeholder="NAME" type="text" name="name" required>
</div>
<div class="app-form-group">
<input class="app-form-control" placeholder="EMAIL" type="email" name="email" required>
</div>
<div class="app-form-group">
<input class="app-form-control" placeholder="BALANCE" type="number" name="balance" required>
</div>
<br>
<div class="app-form-group button">
<input class="app-form-button" type="submit" value="CREATE" name="submit"></input>
<input class="app-form-button" type="reset" value="RESET" name="reset"></input>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
</body>
</html>