-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactUs.php
38 lines (29 loc) · 854 Bytes
/
contactUs.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
require('config.php');
$fname = $lname = $mail = $msg = $usrtel = "";
var_dump($_POST["fname"]);
var_dump($lname);
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$fname = test_input($_POST["fname"]);
$lname = test_input($_POST['lname']);
$mail = test_input($_POST["mail"]);
$msg = test_input($_POST["msg"]);
$usrtel = test_input($_POST["usrtel"]);
}
function test_input($data) {
$data = trim($data);
$data = stripcslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$result = mysqli_query($dbC,"INSERT INTO clientinfo (id, firstname, lastname, email, phone, message)
VALUES (NULL, '$fname', '$lname', '$mail', '$usrtel', '$msg');");
if (!$result) {
die('Invalid query: ' . mysqli_error($dbC));
}
else {
echo "Data Received";
header("Location: submit.html");
}
mysql_close($dbC);
?>