-
Notifications
You must be signed in to change notification settings - Fork 0
/
regcustomer.php
executable file
·38 lines (33 loc) · 1.03 KB
/
regcustomer.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
<?php
session_start();
include('security.php');
$conn = mysqli_connect("localhost", "root", "", "admin");
if(isset($_POST['registerbtn']))
{
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$cpassword = $_POST['confirmpassword'];
if($password === $cpassword)
{
$query = "INSERT INTO customerdetails (username, email, password) VALUES ('$username', '$email', '$password')";
//Running the query.
$query_run = mysqli_query($conn, $query);
if($query_run)
{
$_SESSION['success'] = "Thankyou for choosing Mafundi Services";
header('Location: customerlogin.php');
//echo "saved";
}
else
{
$_SESSION['status'] = "Administrator profile failed to update";
header('Location: a.home.html');
}
}
else
{
$_SESSION['status'] = "The passwords do not match";
header('Location: a.home.html');
}
}