-
Notifications
You must be signed in to change notification settings - Fork 1
/
write_an_article.php
83 lines (77 loc) · 2.44 KB
/
write_an_article.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
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html lang="en">
<head>
<title>Write an Article</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document)
.one('focus.autoExpand', 'textarea.autoExpand', function(){
var savedValue = this.value;
this.value = '';
this.baseScrollHeight = this.scrollHeight;
this.value = savedValue;
})
.on('input.autoExpand', 'textarea.autoExpand', function(){
var minRows = this.getAttribute('data-min-rows')|0, rows;
this.rows = minRows;
rows = Math.ceil((this.scrollHeight - this.baseScrollHeight) / 16);
this.rows = minRows + rows;
});
</script>
<link rel="stylesheet" type="text/css">
</script>
<style type="text/css">
h4{
font-weight: bold;
}
textarea
{
display: block;
box-sizing: padding-box;
overflow: hidden;
padding: 10px;
width: 100%;
font-size: 14px;
margin: 50px auto;
border-radius: 6px;
box-shadow: 2px 2px 8px rgba(black, .3);
border: 1;
}
</style>
</head>
<body>
<div>
<?php
include "navbar.php";
?>
</div>
<form method="post" action="insertarticle.php">
<div class="container">
<br><br><br><h1 style="font-family: Comic Sans MS">Write an Article</h1><br>
<div class="form-group">
<h4 for="titleInput">Title</h4>
<input class="form-control form-control-lg" type="text" id="titleInput" name="title" placeholder="The title of your Article">
</div>
<br>
<h4>Category</h4>
<div class="input-group">
<select class="custom-select" id="categoryselect">
<option selected>Choose...</option>
<option value="1">Science</option>
<option value="2">Motivation</option>
<option value="3">Fiction</option>
</select>
</div>
<br><br>
<h4 for="Textarea1">Body</h4>
<textarea class='autoExpand' rows='5' data-min-rows='5' placeholder='Start writing here...' name="body"></textarea>
<button type="submit" name="publish" class="btn btn-primary btn-lg btn-block">Publish</button><br>
</div>
</form>
</div>
</body>
</html>