-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.php
More file actions
43 lines (27 loc) · 862 Bytes
/
contact.php
File metadata and controls
43 lines (27 loc) · 862 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
if (isset($_POST['submit']))
{
$conn = mysqli_connect("localhost", "root", "", "test");
$name=$_POST['name'];
$gen=$_POST['gender'];
$num=$_POST['cno'];
$mail=$_POST['mail'];
$query= "INSERT INTO `tblcontact` (`user_name`, `gender`, `number`, `user_email`) VALUES ($name,$gen,$num,$mail)";
// if ($_SERVER["REQUEST_METHOD"] === "POST") {
// // collect value of input field
// $data = $_REQUEST['val1'];
// if (empty($data)) {
// echo "data is empty";
// } else {
// echo $data;
// }
// }
mysqli_query($conn, $query);
// Close connection
mysqli_close($conn);
}
// $insert_id = mysqli_insert_id($conn);
// if(!empty($insert_id)) {
// $message = "Your contact information is saved successfully";}
// echo $message;
?>