-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdef.php
More file actions
35 lines (28 loc) · 992 Bytes
/
Copy pathdef.php
File metadata and controls
35 lines (28 loc) · 992 Bytes
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
<?php
if (isset($_POST["submit"])) {
include_once 'DBConnect.php';
$name = $_POST['name'];
$email = $_POST['email'];
$password = md5($_POST['password']);
$database = new dbConnect();
$db = $database->openConnection();
$sql1 = "select name, email from tbl_registered_users where email='$email'";
$user = $db->query($sql1);
$result = $user->fetchAll();
$_SESSION['emailname'] = $result[0]['email'];
if (empty($result)) {
$sql = "insert into tbl_registered_users (name,email, password) values('$name','$email','$password')";
$db->exec($sql);
$database->closeConnection();
$response = array(
"type" => "success",
"message" => "You have registered successfully.<br/><a href='login.php'>Now Login</a>."
);
} else {
$response = array(
"type" => "error",
"message" => "Email already in use."
);
}
}
?>