-
Notifications
You must be signed in to change notification settings - Fork 0
/
ekle.php
48 lines (42 loc) · 1.14 KB
/
ekle.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
<?php
require_once 'config.php';
require_once 'dbconnect.php';
?>
<!DOCTYPE html>
<html>
<head>
<title>Yapılacak Listesi</title>
<link href="https://fonts.googleapis.com/css?family=Ubuntu:400,500,700&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/custom.css">
</head>
<body>
<div class="tema mini-modal">
<div class="hero">
<h2>Ekle</h2>
</div>
<form action="ekle.php" method="post">
<input type="text" name="fbaslik">
<input type="text" name="fdetay">
<button class="buton" type="submit">ekle</button>
</form>
</div>
</body>
</html>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$veri = array(
'baslik' => isset($_POST['fbaslik']) ? trim($_POST['fbaslik']) : '',
'detay' => isset($_POST['fdetay']) ? trim($_POST['fdetay']) : ''
);
if (!empty($veri['baslik']) && !empty($veri['detay'])) {
$db = new connectDB();
if ($db->ekle($veri)) {
echo "Başarıyla eklendi!";
} else {
echo "Ekleme başarısız!";
}
} else {
echo "Lütfen boş alan bırakmayın.";
}
}
?>