-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUntitled-1.php
More file actions
91 lines (73 loc) · 2.45 KB
/
Untitled-1.php
File metadata and controls
91 lines (73 loc) · 2.45 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
$servername = "localhost";
$database = "lor";
$username = "root";
$password = "";
$conn = new mysqli($servername, $username, $password, $database);
(`name`,`email`,`subject`,`message`) VALUES ('$InputName','$InputEmail','$InputSubject','$InputMessage')";
$rs = mysqli_query($conn, $sql);
if($rs)
{
echo "Contact Records Inserted";
}
<?php
$conn = mysqli_connect("localhost", "root", "","lor");
$InputName =isset($_REQUEST["InputName"]);
$InputEmail =isset($_REQUEST["InputEmail"]);
$InputSubject=isset($_REQUEST["InputSubject"]);
$InputMessage =isset($_REQUEST["InputMessage"]);
$sql = "INSERT INTO support(`name`,`email`,`subject`,`message`) VALUES ('$InputName','$InputEmail','$InputSubject','$InputMessage')";
$rs = mysqli_query($conn, $sql);
if($rs)
{
echo "<h3>data stored in a database successfully."
. " Please browse your localhost php my admin"
. " to view the updated data</h3>";
echo nl2br("\n$InputName\n $InputEmail\n "
. "$InputSubject\n $InputMessage\n ");
} else{
echo "ERROR: Hush! Sorry $sql. "
. mysqli_error($conn);
}
mysqli_close($conn);
?>
<?php
$servername = "localhost";
$database = "lor";
$username = "root";
$password = "";
$conn = mysqli_connect($servername, $username, $password, $database);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "<script>
alert('FEEDBACK OR REPORT HAS BEEN SENDING,THANK YOU !!!');
window.location.href='index.php';
</script>";
// menyimpan data kedalam variabel
$name = $_POST['InputName'];
$email = $_POST['InputEmail'];
$subject = $_POST['InputSubject'];
$message = $_POST['InputMessage'];
// query SQL untuk insert data
$query="INSERT INTO support SET nama='$name',email='$email',subjectemail='$subject',messagepesan='$message'";
mysqli_close($conn);
// mengalihkan ke halaman index.php
?>
<?php
$servername = "localhost";
$database = "lor";
$username = "root";
$password = "";
$conn = mysqli_connect($servername, $username, $password, $database);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
if(isset($_POST['submit'])){
$InputName =!isset($_POST['InputName']);
$InputEmail =isset($_POST['InputEmail']);
$InputSubject=!isset($_POST['InputSubject']);
$InputMessage =!isset($_POST['InputMessage']);
$sql = "UPDATE support SET nama='$name',email='$email',subjectemail='$subject',messagepesan='$message'";
}
mysqli_close($conn);
?>