-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
30 lines (24 loc) · 1.06 KB
/
functions.php
File metadata and controls
30 lines (24 loc) · 1.06 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
<?php
include_once('includes/db_connect.php');
class Customer extends db_connection
{
public function add_customer_details()
{
$name = $this->connection->real_escape_string($_POST['name']);
$email = $this->connection->real_escape_string($_POST['email']);
$phone_no = $this->connection->real_escape_string($_POST['phone']);
$subject = $this->connection->real_escape_string($_POST['subject']);
$dept_name = $this->connection->real_escape_string($_POST['dept']);
$message = $this->connection->real_escape_string($_POST['message']);
$insert_query = "INSERT INTO customer (name, email, phone_no, department, subject, message)
VALUES('$name', '$email', '$phone_no', '$dept_name', '$subject', '$message')";
$insert_result = $this->connection->query($insert_query);
if ($insert_result == true) {
header("Location: index.php");
echo "Register Successfully.";
} else {
header("Location: index.php");
echo "Registartion failed.";
}
}
}