-
Notifications
You must be signed in to change notification settings - Fork 0
/
send.php
47 lines (37 loc) · 1.23 KB
/
send.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
39
40
41
42
43
44
45
46
47
<?php
// print_r($_POST);
if (isset($_POST['fname']) && isset($_POST['pnumber']) && isset($_POST['mail']) && isset($_POST['position']) ) {
include 'db_conn.php';
// function validate($data){
// $data = trim($data);
// $data = stripslashes($data);
// $data = htmlspecialchars($data);
// return $data;
// }
$fname = $_POST['fname'];
// $midname = $_POST['midname'];
// $lname = $_POST['lname'];
$pnumber = $_POST['pnumber'];
$mail = $_POST['mail'];
$position = $_POST['position'];
print_r ($pnumber);
if($conn === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
// if (empty($position) || empty($mail) || empty($pnumber) || empty($fname)) {
// header("Location: index.html");
// }else {
$sql = "INSERT INTO Candidates(candidate_name,mobile_no,email,position) VALUES('$fname', '$pnumber','$mail','$position')";
$res = mysqli_query($conn,$sql);
if ($res) {
echo "Your message was sent successfully!";
}
else {
echo "Your message could not be sent!" . mysqli_error($conn);
}
// }
}else {
header("Location: index.html");
}
mysqli_close($conn);
?>