-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush.php
More file actions
28 lines (28 loc) · 799 Bytes
/
Copy pathpush.php
File metadata and controls
28 lines (28 loc) · 799 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
<?php
session_start();
$fullname= $_POST["f"];
$email= $_POST["e"];
$message= $_POST["message"];
$_SESSION["name"]=$fullname;
require_once("db.php");
//storing data into cform table
if (empty($fullname)) {
header('location:contactus.php?empty="1"');
}
elseif (empty($email)) {
header('location:contactus.php?empty="1"');
}
elseif (empty($message)) {
header('location:contactus.php?empty="1"');
}
else{
$query= $db->prepare('INSERT INTO cform (fullname, email, message) VALUES (:fullname, :email, :message)');
$query->execute(array(
':fullname'=> $fullname,
':email'=>$email,
':message'=> $message,
));
//redirecting to thanks.php page
header ("location:thanks.php");
}
?>