-
Notifications
You must be signed in to change notification settings - Fork 0
/
ajax.php
38 lines (29 loc) · 971 Bytes
/
ajax.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
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
//Your function Code
?>
<?php
include 'include/db.php';
if (isset($_POST['submit_btn'])) {
// storing in database
$name = $_POST['name'];
$email = $_POST['mail'];
$business = $_POST['business'];
$message = $_POST['message'];
$project = $_POST['project'];
$tel = $_POST['tel'];
if($_POST["name"]!="" || $_POST["mail"]!="" || $_POST["message"]!="" || $_POST["project"]!="" || $_POST["tel"]!="") {
$sql = "INSERT INTO contact (name, mail, business, message, project, tel)
VALUES ('$name', '$email', '$business','$message','$project','$tel')";
if ($con->multi_query($sql) === TRUE) {
header("Location:index.php");
} else {
echo "Error: " . $sql . "<br>" . $con->error;
}
} else {
echo "Hata";
}
exit;
}
?>