-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_org.php
74 lines (60 loc) · 2.52 KB
/
add_org.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
71
72
73
74
<?php
session_start();
require_once "mysql.php";
if(isset($_POST["ad"]) && isset($_POST["aciklama"])){ //form çıktısı alındı mı kontrol eder.
$form_ad = $_POST["ad"];
$form_aciklama = $_POST["aciklama"];
mysqli_query($db, "INSERT INTO `organizations` (`name`,`about`) VALUES ('$form_ad','$form_aciklama')");
//forma göre veritabanına ekleme yapılır.
if (mysqli_errno($db) != 0) {
echo "Hata";
exit();
}
header("Location: author.php");
}
else {
?>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Organizations</title>
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/contact.css">
</head>
<body>
<section class="hero is-fullheight">
<div class="hero-body">
<div class="container has-text-centered">
<div class="columns is-8 is-variable ">
<div class="column is-one-thirds has-text-left"></div>
<div class="column is-one-thirds has-text-left">
<form action="add_org.php" method="post">
<div class="field">
<label class="label">Organization Name</label>
<div class="control">
<input class="input is-medium" type="text" name="ad">
</div>
</div>
<div class="field">
<label class="label">About</label>
<div class="control">
<textarea class="textarea is-medium" name="aciklama"></textarea>
</div>
</div>
<div class="control">
<button type="submit" class="button is-link is-fullwidth has-text-weight-medium is-medium">Add Organization</button>
</div>
</form>
</div>
<div class="column is-one-thirds has-text-left"></div>
</div>
</div>
</div>
</section>
</body>
</html>
<?php
}
?>