-
Notifications
You must be signed in to change notification settings - Fork 3
/
i_ttg_kami_post.php
executable file
·70 lines (49 loc) · 1.46 KB
/
i_ttg_kami_post.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
sleep(1);
session_start();
//ambil nilai
require("inc/config.php");
require("inc/fungsi.php");
require("inc/koneksi.php");
nocache;
//nilai
$filenya = "$sumber/i_ttg_kami.php";
$filenyax = "$sumber/i_ttg_kami_post.php";
$judul = "Tentang Kami";
$juduli = $judul;
//ambil nilai
$aksi = nosql($_GET['aksi']);
//PROSES ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//jika simpan entri
if ($aksi == "simpan")
{
//ambil nilai
$e_nama = trim(cegah($_GET["e_nama"]));
$e_alamat = trim(cegah($_GET["e_alamat"]));
$e_email = trim(cegah($_GET["e_email"]));
$e_telp = trim(cegah($_GET["e_telp"]));
$e_isi = trim(cegah($_GET["e_isi"]));
//echo "$e_nama, $e_alamat, $e_email, $e_telp, $e_isi";
//cek
if ((empty($e_nama)) OR (empty($e_email)) OR (empty($e_isi)))
{
echo "<h3>ENTRI TIDAK LENGKAP</h3>";
exit();
}
else
{
if ($_SESSION['cekya'] != $e_nama)
{
//insert
mysqli_query($koneksi, "INSERT INTO bukutamu(kd, nama, alamat, telp, email, isi, postdate) VALUES ".
"('$x', '$e_nama', '$e_alamat', '$e_telp', '$e_email', '$e_isi', '$today');");
echo "<h3>Terima Kasih, Telah Menghubungi Kami</h3>";
//bikin sesi deteksi, biar gak dobel
$_SESSION['cekya'] = $e_nama;
}
exit();
}
exit();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
?>