-
Notifications
You must be signed in to change notification settings - Fork 0
/
registration.php
58 lines (45 loc) · 1.75 KB
/
registration.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
55
56
57
58
<?php
require('admin/incl/const.php');
require('admin/class/database.php');
$database = new Database(DB_HOST, DB_NAME, DB_USER, DB_PASS, DB_PORT, DB_SCMA);
$dbconn = $database->getConn();
if(isset($_POST['submit'])&&!empty($_POST['submit'])){
$sql = "insert into public.enduser(name,email,password)values('".$_POST['name']."','".$_POST['email']."','".password_hash($_POST['password'], PASSWORD_DEFAULT)."')";
$ret = pg_query($dbconn, $sql);
if($ret){
echo "Data saved Successfully";
}else{
echo "Soething Went Wrong";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Register New User </title>
<meta name="keywords" content="PHP,PostgreSQL,Insert,Login">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Register Here </h2>
<form method="post">
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" id="name" placeholder="Enter name" name="name" requuired>
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email" placeholder="Enter email" name="email">
</div>
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd" placeholder="Enter password" name="pwd">
</div>
<input type="submit" name="submit" class="btn btn-primary" value="Submit">
</form>
</div>
</body>
</html>